Reputation: 14470
I have a report structure which similar to this
Report Header
--Cross Tab
Page Header
--Header
Group Header1
--Cross Tab
Group Header2
--Details
I am trying to display the page header only in the pages where Group2 start. I have skip the page header in only 1st page.
Is it possible in crystal report??
Thanks
Edit
This is how report currently looks like
Upvotes: 1
Views: 7077
Reputation: 11
I needed to do something similar, but it took some fiddling to make Crystal do what was desired.
My basic challenge was to display a "large" page header at the start of each "section" of a report, then switch to a one line page header for all other pages.
PHa has the large header. In the Section Expert, click on the conditional Suppress, add the following code:
Shared numbervar big_header;
big_header = 0; //suppress if big_header is off
PHb has the one line header. In the Section Expert, click on the conditional Suppress, add the following code:
Shared numbervar big_header;
big_header = 1; //suppress if big_header is on
For each report section, create a pair of formulas (you can't reuse them, you have to make a new pair for each), one to set big_header to 1, and one to set it back to 0.
shared numbervar big_header;
big_header := 1; //turn on big_header
shared numbervar big_header;
big_header := 0; //turn off big_header
Place the one that turns big_header on in an otherwise blank detail section (or group -- should work, haven't tested), format the formula to be suppressed, format the section to have a new page before if it's not the very first one on the report (Paging tab) and suppress blank section.
In the next detail (group) section (which should display stuff on the report), place the formula that turns big_header off. Again, format the formula to be suppressed.
Repeat as necessary. (My "turn the big_header on" formula also sets a string that is used in the common footer.)
Hope this helps!
Upvotes: 1
Reputation: 7287
This is just my gut feeling, but I don't think this is possible without some other modifications to the report. Crystal doesn't determine the placement of sections until the final pass which is also the latest you can force formulas to evaluate, but then the report header suppression formulas will evaluate before any formulas in GH2. In other words, as long as you have sections of variable size printing on the page, there is no way for Crystal to know during the Page Header printing whether a GH2 will appear on that page or not.
The only solutions I can think of are to preemptively handle it for any possible page layout. For example, one way is to set the GH2 to always begin on a new page (via "New Page Before"), and selectively suppress any page headers that fall between a GH1 and a GH2 (via a booleanvar that is set "whileprintingrecords" in GH1 and unset in GH2). There are probably other, cleaner ways of doing this, though.
EDIT: What's the motivation for doing this (page layout specifics would be helpful)? There's probably a way around it that doesn't involve solving this exact problem.
Upvotes: 1
Reputation: 26272
If you just need to suppress the page-header section on the first page, add this text to the page-header's conditional-suppression formula:
PageNumber=1
Upvotes: 0