Interested in Crystal Reports Training? Check out our Course List to view course outlinesFor more information about Crystal Reports training, please call (512) 794-8440 or please fill out our Class Information Request Form and we will contact you with more information.
|
In Crystal Reports (CR), when printing or previewing a report, the Group Header displays at the bottom of the page and the group’s records appear on the following page instead of on the same page as the Group Header. This is also known as an orphaned group header.
How do you prevent an orphaned group header? There are two ways.
Method One:
You can select the ‘Keep Group Together’ option available in the ‘Group Expert’, similar to the option found in the ‘Section Expert’. You can access the Group Expert through ‘Report’ on the menu (‘Change Group Expert’ in CR 8.5 and earlier).
– OR –
Method Two:
-
Insert a section below the Group Header to create Group Header 1a and Group Header 1b.
-
Copy all the fields from the Details section into Group Header 1b. Group Header 1b and the Details section must appear in the same format.
-
Copy the original Group Header into Group Header 1a.
-
From the ‘Report’ menu, click ‘Section Expert’. (In CR 8.5 and earlier, from the ‘Format’ menu, click ‘Section’.)
-
From the ‘Section Expert’ dialog box, select ‘Group Header’ from the list of sections and select the ‘Keep Together’ check box.
-
Select ‘Details’ from the list of sections and click the ‘X + 2’ button beside the ‘Suppress’ check box. Keep this check box unselected.
-
In the ‘Format Formula Editor’ dialog box, type the following conditional suppression formula:
//This formula conditionally suppresses the first record of the Details //section.
//Replace {database.field} with the field by which you are grouping.
WhilePrintingRecords;
Onfirstrecord or {database.field} <> Previous({database.field})
Upon completing these steps, the Details section will display all the group’s records except for the first record. Group Header 1b will always display the first record. If the group’s records display on the following page, Group Header 1a and Group Header 1b will always print together. Therefore, this solution will prevent the appearance of an orphaned group header.
Subscribe to Monthly Training Updates
Receive monthly productivity and training insights, software tips, and notices of upcoming classes!