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 Pg Header After Last Record Read? 1

Status
Not open for further replies.

alhamil5

Programmer
Feb 20, 2003
19
US
I'm at wit's end with this...what 'suppress' formula should I enter in my page header so that the page header WILL print on any page where a detail record appears, but WILL NOT print on any pages that come after the final record in the detail section has printed? I don't want the page header from the main report to print on the subreport pages. Basically, I just want the page header to 'turn off' after the last record is read and printed in the detail section.

I can't seem to find any Crystal Syntax that references an EOF condition. I've tried simply entering "OnLastRecord", which does a good job of keeping the page header off of every page after the last detail record, but unfortunately it also keeps the page header off of the last page containing any detail records. I've also tried "NextIsNull[detail_field]", but again, this causes the page header to suppress on the page where the last detail record appears. Any input is much appreciated. =P
 
Why do you have any pages after the last record?

I'll assume that you have a subreport:

Create a formula to use for suppression:

Report header:

global booleanvar suppressit := false;

In a section just before the subreport fires (if you want to turn the header back on):

global booleanvar suppressit := true;

In the page header suppression formula:

global booleanvar suppressit;
suppressit

-k
 
Sorry, a bit of a typo there:

In a section just before the subreport fires (if you want to turn the header back on set it back to false after the subreport fires):

global booleanvar suppressit := true;

-k
 
Thanks, Syn. You're so helpful to everyone with this stuff, maybe you should write a book. The Crystal books I have are all either way too simple ('here's how to run the Crystal wizards' type stuff) or way too esoteric ('here's how to embed a field in your underlaid chart and make its color change based on subreport selection criteria' type stuff).

If you don't write a book, at least you'll know you've got plenty of good karma going into the afterlife. =)
 
Syn - I spoke too soon! I did what you suggested but now the page header is just suppressed on EVERY page. Any ideas?
 
Just to clarify--OnLastRecord will work EXCEPT when there is only one detail on the last detail page. If there are two details, the page header will appear on that page, but not on following ones. So another method would be to ensure that at least two records appear on each page--but I'm not sure how to do that, other than manually adjusting the detail section to force this to be the case. Using "keep together" for groups and for sections probably helps limit the occurrence of only one detail on a page, but doesn't guarantee it won't happen.

-LB
 
Do you have a subreport? I never did learn why you have additional pages.

Where did you place the formulas?

-k
 
Yes Syn, I actually have two subreports, each of which is in its own Report Footer section---they should only print AFTER all the detail records of the main report have printed. I put the 'suppressit' code where your post indicated - first = false in the Report Header, then = true in a section immediately preceding my first subreport (tried w/ existing report section, and also in a newly created section that only had the 'suppressit' code in it), and then the code as you indicated in the Page Header suppress formula. I didn't want to turn the header back on once it was off.

I just can't understand why there isn't a native function to turn off the page header after the last detail record of the main report prints; isn't it fairly common for people to have a different page header in their subreports, as I do, and therefore to NOT want the main report page header printing on subreport pages? =\
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top