Suppressing Page Header in Crystal Reports

Summary

How to create a different page header at the end of the report in Crystal Reports.

Body

Prerequisites / Minimum Requirements

  • Crystal Reports full version.
  • Need for a different page header at the end of the report

End State / Outcome

  • Crystal Report where page headers can heat

How to Steps

Suppressing Page Header in Crystal Reports

Formatting - Creating a different page header at the end of the report.

Crystal Reports – Suppress Page Header on the Last Pages

Objects in the report footer can potentially add several pages after the regular report pages. This could be caused by a subreport, a crosstab or a large block of legalese. This may require the Page Header for those pages to be different.

Easiest solution - suppressing the Page Header with the function OnLastRecord.

Select Section Expert, Page Header, Conditional Formatting Icon to the right of Suppress (No Drill-Down), entering the value OnLastRecord.

 

While this probably works 97% of the time, you may have an occurrence where the last record of the report is the only record on the last page. Your Page Header will be OnLastRecord, so the page headers will not display but you will still want the headings on that page over the last record's data.

More reliable method: create a flag to tell the report when to switch.

Insert a new subsection below your last Report  Footer section.

Suppress this new subsection of the Report Footer.

Create a formula field, placing it in the suppressed report footer:

 

//{@Set RFPassed}

WhilePrintingRecords;

BooleanVar RFPassed := True

 

Use the following suppress formula for the Page Header to be  suppressed:

WhilePrintingRecords;

BooleanVar RFPassed

 

When the report gets to the suppressed Report Footer it triggers the formula which changes the variable from True to False. Every Page Header before that point will have seen the variable as False and won't suppress the section. But after that point the Page  Header will see the variable as True and will suppress the section.

Test results, comparing to previous report if this is a report improvement, and/or to database queries.

Details

Details

Article ID: 361
Created
Tue 11/28/23 12:57 PM
Modified
Fri 11/15/24 9:00 AM