Want to protect your cyber security and still get fast solutions? Ask a secure question today.Go Premium


Crystal Reports Section Suppression Question...

Posted on 2010-01-07
Medium Priority
Last Modified: 2012-08-14
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.


Question by:faclogistics
  • 3
  • 2
LVL 35

Expert Comment

ID: 26206662
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;

 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.


Author Comment

ID: 26209427
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!

LVL 35

Accepted Solution

James0628 earned 2000 total points
ID: 26210487
I just realized that I was assuming that the group header would always be printed at the top of the page.  IOW, that you had "new page after" set on the group footer.  That's just the image I had in my head when I was thinking about this.

 If you don't do that, then the first group header for a new group could print somewhere in the middle of a page, and the top of the next page would show the second group header section, because the group started on the previous page.  I'm not sure if that explains what you're seeing, but I think it might.

 If you don't have "new page after" set on the group footer, could you try that and see if it helps?

 > The same goes for the group footer.

 Did you mean page footer?


Author Comment

ID: 26213025

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!

LVL 35

Expert Comment

ID: 26242243
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.


Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
This video shows how to quickly and easily deploy an email signature for all users in Office 365 and prevent it from being added to replies and forwards. (the resulting signature is applied on the server level in Exchange Online) The email signat…
Enter Foreign and Special Characters Enter characters you can't find on a keyboard using its ASCII code ... and learn how to make a handy reference for yourself using Excel ~ Use these codes in any Windows application! ... whether it is a Micr…
Suggested Courses

564 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question