Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Supress page footer if sub report is blank

Status
Not open for further replies.

Snakeroot

Technical User
Oct 4, 2006
112
US
I'm using Crystal XI.

I have a report with 3 subreports. One subreport is in the report header and works as it should.

The issue I'm having is with the two subreports at the end of the report. I currently have them in Report Footer a and Report Footer b. They could be moved to Group Footer b and Group Footer c if need be.

The problem I have is that although the subreports are being supressed when there's no matching company name to the main report, I'm still getting a page footer.

This is already confusing and I'm writing it. I'm basically making a report that will do this:


Section 1 is a cover page displaying a subreport with graphs

Section 2 is a summary page for Tank Service using a crosstab

Section 3 is the line details of the Tank Service done

Section 4 is a subreport of a summary page for Recovery Service (similar to Section 2, but for recovery and in a subreport)

Section 5 is a subreport (using the same data as Section 4) with line details of the Recovery Service done (similar to Section 3, but for Recovery Service and in a subreport)

** Each "Section" could be multiple pages or one page long

When I have a company that has had Tank Service, but no Recovery Service, I'm getting Section 1, 2, 3, then blank page for Section 4 with the page footer at the bottom, and then blank page for Section 5 with the page footer at the bottom.

What I would like to have happen is when Section 4 and 5 are supressed, I would like the report ended, so there aren't 2 blank pages and vise versa if a company has had only Recovery Service and not Tank Service.

Can someone tell me how to supress the page footer when the only thing on a page is a supressed subreport? Thanks!

Snakeroot
 
Set some values before running the subreports, as in:

whileprintingrecords;
shared booleanvar sub1empty:=true;
shared booleanvar sub2empty:=true;

Then in the subreports set them if they are not empty:

//sub1
whileprintingrecords;
shared booleanvar sub1empty;
if <condition> then
sub1empty:=false;

//sub2
whileprintingrecords;
shared booleanvar sub2empty;
if <condition> then
sub2empty:=false;

Now in the suppress of the page footer use
Whileprintingrecords;
sub1empty
and
sub2empty

-k
 
Thanks for the response!

When I place:

Whileprintingrecords;
sub1empty and sub2empty

in the page footer, I get this error:

Remaining text doesn't not appear to be part of the formula.

Any idea why I'm getting this message?
 
Do you have the report footer sections formatted to "suppress blank sections"? And do you have the subreports themselves formatted to "suppress blank subreports"? And did you suppress all unused sections within the subreport?

If the page footers are in the subreport and contain some content, then they should be conditionally suppressed by using a formula in the subreport->section expert->page footer->suppress->x+2 area:

isnull({table.somerecurringfield})

-LB
 
LB,

I did do what you suggested... the subreports are being suppressed, but I'm showing the page footer still. The page footer is not part of the subreport (the subreport doesn't have page footer sections).

So, the problem with isnull({table.somerecurringfield}) is that on the main report I may have data where I won't have data on the subreport.
 
did you check the options supress black subreport and supress black sections with in the subreport and the place where the subreports are placed
 
Right, I should have said subreport report footer.

If you checked "suppress blank section" on the main report report footer section, then I wonder if you are getting these blank pages because you have formatted the report footer sections to "new page after"?

-LB
 
1973kk,

Yes I have checked supress 'blanks' where you have suggested.

lbass,

I have supressed the report footers in both subreports completely (there's nothing of use in them), and I still get the same result. However, I did notice a couple of peculiar things that I can't explain, hopefully someone here can.

1) I had Report footers a, b, and c (which were just hanging around from previous attempts at designing this report in my 2nd subreport. In Section Expert, when I got to Report footers, it had a checked checkbox next to new page after, but it was grayed out. Not sure why this happened, but since I wasn't using the seperate footers anyway, I just deleted b, and c, and suppressed the main footer now. Now it shows an unchecked checkbox for new page after.

2) Had the same situation on the main report, but I deleted the subsections I wasn't using and the new page after isn't checked anymore.

These two things don't seem to be an issue, I was just wondering if there was any explaination for the grayed out boxes that were checked.

3) I tried supressing both subreports, and obviously that works as it should on data where there should be no subreports listed. Then, I unchecked the first subreport and it gives me one extra blank page with just a page footer. I unsupressed the 2nd subreport so that now they're both unsupressed and again, I still only have one extra blank page with just a page footer.
Next, I supressed only the first subreport, and I still get the same result... one blank page with a page footer.

I'm stumped.
 
Is there any formula way to supress the page footer if Report Footer a is blank?
 
I don't think the page footers are the problem if they are empty. They wouldn't cause a page to appear. Do you have new page before or new page after checked on ANY section in the report?

When there is no data in the subreports, does anything appear on the page, e.g., column headers or the subreport border?

On the blank pages, what report sections do you see identified in the gray area to the left of the report canvas?

-LB
 
Thanks for responding... I'll check and see if any sections have new page before or after. I don't believe they do, but I"ll double check that.

As for the blank pages, there are no report sections identified in the gray area to the left, except the PF section. Above that is just blank with a bracket like this:

---
|
|
|
|
|
|
|
|
---
PF
---

 
Here's what I have for my main report:

Report Header - NewPageAfter is checked

Group Header 1a - NewPage Before & After checked

Now, this is weird... since my 2nd previous post, this has changed:

Page Footer - New Page After grayed out & Print at bottom of page grayed out - BOTH are checked

Not sure how/when the new page after and print at bottom got checked, and not sure why they're grayed out.

 
You did not indicate before that you had a group. Are the subreports in the group footer sections?

It doesn't matter that those items are checked if they are grayed out.

Are you sure there are no other sections identified in the gray area besides the PF? I can't think of a situation where this could occur unless the subreport is extending into the page and it has blank areas. I suggest you go through each subreport and the main report section expert and check "suppress blank section" for every section.

-LB
 
Scratch the response below... as I was writing, I figured out what happened... actually you figured it out, it just finally smacked me up side the head :) The page footer, was too large... once I got rid of some white space it ended like it was supposed to and didn't carry to the next page.

It didn't occur to me that it was carrying over becuase it looked different on each page. There was a red line across the bottom, with a page number 3 on one page, and a red line across the bottom with a page number 4 on the blank page.

Anyways, thanks AGAIN lbass for your help! Much appreciated!


-SR


----------------------Disregard below this line--------


I'm sorry... I interpreted the report sections on the left wrong... that's not actually a bracket that I'm seeing... it's a line at the top of the page, then it's blank and then there's a line at the bottom that indicates page footer like this:


--------







-------
PF

I was seeing the line seperating the two windows, and thought it was a bracket, but looking at the previous pages, I realize it's not a bracket, it's just the edge of the window.

As for the groups, I appologize for not mentioning this. I actually have 4 groups. The groups I'm using are:

Group Header 1 a & b
Group Header 2 is supressed
Group Header 3
Group Header 4 is supressed
Details
Group Footer 4 (line seperator for each detail line)
Group Footer 3 is supressed
Group Footer 2 (line seperator for each invoice number)
Group Footer 1 is supressed





 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top