Link to home
Start Free TrialLog in
Avatar of faclogistics
faclogistics

asked on

Crystal Reports Section Suppression Question...

I have a Crystal Report with a page header, page footer, details and two groups.  I want to suppress the page header and the page footer sections when the text in the Group Header #1 section is visible to the screen.  Once the user clicks the next page or previous page navigational button to show the fields in the details section, I want to see the page header and page footer sections.  I am trying to find the correct formulas and where and how to place them in order to get this desired result.  But, once the text from the Group Header #1 section is visible again by either clicking the next or previous navigational buttons, then the page header and page footers should be suppressed.

Thanks!

Jerry
Avatar of James0628
James0628

I'm a bit skeptical about whether or not you can do this, but here are a couple of ideas.

 Suppress your page header section.

 Create a second group header (GH) section and put the fields from the page header in the new GH section.

 Go to the options for the group and turn on the "Repeat Group Header On Each Page" option.

 Use InRepeatedGroupHeader to suppress the original GH section when it's not the first page for a group (InRepeatedGroupHeader), and suppress the new GH section (with the page header fields) when it is the first page for a group (not InRepeatedGroupHeader).

 Then, in theory, you'll see the original GH section on the first page for a group, and the new GH section (with the page header fields) on the following pages for a group.  In practice, there are various complications that could come into play.

 As for the page footer, you could try setting a variable in the main GH section, depending on InRepeatedGroupHeader, and use that variable to suppress the page footer section.  Something like this in the GH section:

Shared BooleanVar first_page;
first_page := not InRepeatedGroupHeader;
""

 Then use something like this to suppress the page footer:

Shared BooleanVar first_page;
first_page


 In theory, that would suppress the page footer on the first page of a group.  However, note that when a page footer section is conditionally suppressed like that, CR still reserves space for it, so you won't see the section on the report, but there will be some blank space where it would be.  That's true in CR 10.  I don't know if that has changed in later versions.  The only thing you can do about that is to try to make the page footer section as small as possible, to minimize the reserved space.

 Hope some of this helps.

 James
Avatar of faclogistics

ASKER

OK, I did as commented, however, when I run the report, It starts out with the first group as desired, meaning I see the desired results as I expect to see. But, as soon as the group changes, the text in the newly created group header gets displayed  throughout the remainder of the pages regardless of the fact that the group continues to change.

This is not the desired result.  I only want to see what is in the original group header when it is the very first page of a new group and each page thereafter to only display what is in the newly created group header.  The same goes for the group footer.

Please advise... Thanks!

Jerry
ASKER CERTIFIED SOLUTION
Avatar of James0628
James0628

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Great!

That did the trick! One thing that I had to do that was not mentioned was to uncheck the "new page after" setting on the group footer and instead, place the formula
 in the "new page after" setting, "Not OnLastRecord" to prevent a blank page from being displayed at the end of the data being listed on the report.

Other than that, the solution suggested did the trick.

Thanks a Bunch!

Jerry
True, you could get an extra page at the end, but you figured out how to avoid that.

 You're welcome.  I'm glad, and a bit surprised :-), that I could help.  I really wasn't at all sure that it would work for you.  The way CR builds the report output can make things like this really tricky, if not impossible.

 James