Last month I wrote an article about suppressing the page header on the last page when there are no details. This is handy if your last page is a subreport, a chart or a cross-tab. After my newsletter went out one of my readers shared her approach to the same problem. She uses the group header of a dummy group, and sets it to “repeat” on each page.
Any time you have a Group Header you can set it to repeat on each page. One feature of a repeating GH is that it won’t appear on the last page of a group, unless that page has at least one detail record. I wrote about that behavior in another article long ago. So the only trick is to create a primary group that includes every record in the report. Then you set this group header to repeat on each page and it behaves just like a page header, with the exception of not printing on the last page.
So how do you create a group that includes all the records in the report? You group on a value that doesn’t change. If you have a DB field like “company” that doesn’t change you can use it. But you can always create a formula that isn’t tied to any data fields. My favorite dummy group formula is:
The word “All” can be any value. Just keep in mind it will appear as the overall node of the group tree so you might want it to make some sense. The WhileReadingRecords function allows the report to see this static value as a recurring value, which makes it eligible for grouping.
Once you create the formula you use it as Group 1 in the report and then go into Group Options and check “Repeat Group Header on each new page”. If you put your column headings in this Group Header they will appear on every page, but won’t appear on the last page (unless there are details printing on that page).
And thanks to Tina Nordyke, the DBA for Advocates for Basic Legal Equality, Inc for suggesting this method.(For examples of my most popular formulas, please visit the FORMULAS page on my website.)