SAP Knowledge Base Article - Public

3470302 - Text in Report Footer prints on 2 pages when conditionally suppressing the Page Header to not show on the last page, in Crystal Reports

Symptom

  • Report Footer prints on 2 pages, despite the text can fit on one page.
  • Large text expected to print on one page, prints on 2 pages, at the end of the report.
  • When conditionally suppressing the Page Header of a report to not show on the last page, the text in the Report Footer prints on 2 pages in Crystal Reports.

Environment

  • SAP Crystal Reports 2016
  • SAP Crystal Reports 2020

Reproducing the Issue

  • In Crystal Reports, create a report based on any data source.
  • Insert database fields in the Details section.
  • Insert text in the Page Header section.
  • Insert a large text that fit on one page in the Report Footer section.
  • Conditionally suppress the Page Header section, so it print on all pages, except the last page using the formula:  pagenumber = totalpagecount
  • When viewing the report, the text located in the Report Footer section prints on 2 pages, instead of on one page.

Cause

  • Expected behavior when conditionally suppressing the Page Header section.
  • Large text that fit on one page, located in the Report Footer section, does not print on one page, because when the page is generated, it first reserves the space for the Page Header section, then it evaluate the conditional suppression: pagenumber = totalpagecount, which suppress the Page Header to display on the last page, but since the space have already been reserved for it, it does not leave enough room for the large text, located in the Report Footer section to print on one page, therefore it prints the text on 2 pages. 

Resolution

  • To not reserve space for a conditionally suppressed Page Header section, use a Group Header, formatted to display like a Page Header.
  • Group Header does not reserve space before the page is generated, therefore it will allow more room on the last page of the report to print large text that fit on a page.
    1. In Crystal Reports, create a formula, with the following code:     

           WhileReadingRecords; " "
         
    2. Save the formula under any name. For example: My Page Header
         
    3. Insert the formula as a group
      3.1  Under the menu "Insert", select "Group..."
      3.2  In "Insert Group", select the formula created in the previous steps.
         
    4. Check the group option "Repeat Group Header On Each Page" 
      4.1  Still in "Insert Group", select the tab "Options"
      4.2  Check the option: "Repeat Group Header On Each Page" 
      4.3  Click "OK" to create the group.
         
    5. If you have multiple groups already on the report, set the group as the first group.
      5.1  Under the menu "Report", select "Group Expert"
      5.2  In "Group Expert", under "Group By", select the last group you just created.
      5.3  Click on the upper arrow to move the group to become the first group.
      5.4  Click "OK"
        
    6. Resize the Group #1 section to be the same height as the current Page Header section.
       
    7. Move the objects from the Page Header section, to the Group Header #1 section.
        
    8. Remove the conditional suppression from the Page Header section, and suppress it.
         
    9. Add the conditional suppression for the Group Header #1 to be:

           pagenumber = totalpagecount
         
    10. Suppress the Group Footer #1
        
    11. Save the updated report.

Keywords

CR , KBA , BI-RA-CR , Crystal Reports designer or Business View Manager , Problem

Product

SAP Crystal Reports 2016 ; SAP Crystal Reports 2020