Crystal Reports - repeat page header when data changes

thursdaysgeek picture thursdaysgeek · Jun 16, 2011 · Viewed 24.7k times · Source

I have a report that is pretty complex, with multiple sub-reports for each item selected. I want a main header for each item, and then a page header for that item at the top of each page. If I only select one item it looks great. If I have multiple items, that main page header only shows once.

main header
page header item 1
details

page header item 1
details

page header item 1
details

main header
page header item 2
details

page header item 2
details

How do I design it so that Item 2 main header shows up?

The details are a series of group headers (I inherited this report). Right now it has just what I want, except that the main header shows once and only once. It is in a Report Header section, the page header is a Page Header section, and all the rest of the reports (which can span multiple pages) are in various Group Header sections.

edit: I can put both the main header and the page header in a Page Header a and Page Header b section, with the item id in both. Now, if I can suppress Page Header a if item id is duplicated, it should print it only with a new item id, and the page header b will still print at the top of each page.

Answer

RThomas picture RThomas · Jun 16, 2011

Since a report only has one "Report Header", you'll have to organize your groups in a way that "main header" is a top level group, "page header" is a sub group, and finally details is below that.

Once you have that done you can then click on the Paging tab in section expert and click the New Page Before option in order to get the pages to break like you expect.

Edit: Under menu Report, Group Export, in the Group By, there is an Options button, and then an Options tab. That is where the Repeat Group Header on Each Page option is. Then, back in the Section Expert for the Main Header Group, in the Suppress function, put InRepeatedGroupHeader. That way, the Main Header (GroupHeader#1a) is suppressed except for the first page for each item, and the Page Header (GroupHeader#1b) shows at the top of each page.