Change Report Header

Options
rmurphy
edited July 28, 2021 in Analytics #1
An approach to controlling what displays as a table header on each page of a report.<br />
<br />
When designing a BIRT report, sometimes it is necessary to change a table header after the first page of the report. The key to doing this is to not use the header row of the table, but use another detail row and set a page break interval on your table.<br />
<br />
Then, in script, control the visibility of items in the detail row that is serving as your header.<br />
<br />
The attached report design uses the following script events:<br />
- report's beforeFactory method<br />
- second detail row's onCreate method<br />
- table's onPageBreak method<br />
<br />
Visibility is set on each row of both grids in the top detail row.<br />
<br />
The first time the first detail row is encountered, the first page header is displayed. When the second detail row is created, we set the global variable controling the visibility of the grid header rows to false. Once we have hit the page break interval set on the table, the table, the onPageBreak event is called and we set the global variable to allow the header value for all subsequent pages to be visible. At this point we continue this process until the end of the report has been reached.