Technical Questions
 Crystal Reports Forum : Crystal Reports 9 through 2022 : Technical Questions
Message Icon Topic: page header suppression Post Reply Post New Topic
Author Message
pgiering
Newbie
Newbie


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 37
Quote pgiering Replybullet Topic: page header suppression
     Posted: 24 Nov 2009 at 1:53pm
Hi, I have a report with two sub-reports built into it.  The report prints as one report, with the main detail printing first, then the first sub-report, and then the next. 
 
The Page Header for the first report prints fine on all those pages, however, once the sub-report data starts, I want to suppress the page header from the main report, as the sub-report has its own, and the main header doesn't actually match the data of the subr-eport.
 
Does anyone know how I can suppress the headers when I'm in a report footer that contains a sub-report?  I am open to other work-arounds too.
 
Thanks,
 
Paul


Edited by pgiering - 24 Nov 2009 at 1:54pm
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 25 Nov 2009 at 5:02am
I had this exact problem happen to me. Basically, I used a number variable formula that initialized on the Report Header:
 
global numbervar nHeader:=0;
 
I then added another number variable formula that initialize right before the sub report:
 
global numbervar nHeader:=1;
 
Then suppress the page header where global numbervar nHeader=1 or it may have to be where global numbervar nHeader<>0.
 
Does your subreport have more than one page? I did notice that my subreports would not allow me to add page headers, only report headers. Therefore, I had to create page headers within the main report to go along with the sub report. I suppressed those headers where global numbervar nHeader=0 or where global numbervar nHeader<>1.
 
I hope this gets you your desired result.


Edited by FrnhtGLI - 25 Nov 2009 at 5:12am
IP IP Logged
pgiering
Newbie
Newbie


Joined: 25 Aug 2009
Location: United States
Online Status: Offline
Posts: 37
Quote pgiering Replybullet Posted: 25 Nov 2009 at 3:40pm
Thanks FrnhtGLi,
 
I think I understand the logic, but I'm not sure how to apply the code?  What do you mean "...initialized on the report header"?  that is the part I don't know how to do.
 
One of the subreports has multiple pages (2-3), the other will only be one page.
 
Thanks,
 
Paul
IP IP Logged
FrnhtGLI
Senior Member
Senior Member
Avatar

Joined: 22 May 2009
Online Status: Offline
Posts: 347
Quote FrnhtGLI Replybullet Posted: 27 Nov 2009 at 6:05am
When I say 'initialize on the Report Header' I mean to create the formula: global numbervar n Header:=0;  that starts the running total and place the formula field in the Report Header section of the report. Then suppress the formula field so that it doesn't display the 0 on the report.
 
Also, create two more formula fields: global numbervar nHeader:=1; and global numbervar nHeader:=2;. Place one before the first sub report and the other before the second sub report. You may have to use report footers for these sub reports so the rest of the information doesn't get evaluated again. If needed, created Report Footer A, B, C, D. Place one of the two formula fields, suppressed, in Report Footer A, then put the first sub report in Report Footer B. Place the second, suppressed, in Report Footer C, and the second sub report in Report Footer D.
 
Create your page headers for your main report, sub 1 and sub 2 all in the main report. In the section expert, suppress the main report page header using the following logic: global numbervar nHeader<>0
 
Suppress the Sub 1 page header with the following logic: global numbervar nHeader<>1
 
Suppress the Sub 2 page header with the following logic: global numbervar nHeader<>2
 
I hope this explanation was better for you. If not, let me know.
IP IP Logged
Printable version Printable version

Forum Jump
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot delete your posts in this forum
You cannot edit your posts in this forum
You cannot create polls in this forum
You cannot vote in polls in this forum