Designing the page header and footer
The default master page includes a text element that displays the current date in the page footer. When previewing a report, the current date appears on the bottom left of every report page. You can delete or edit this text element. You can add other elements to the master page by dragging them from the palette and dropping them in the page footer or header.
Observe the following rules:
You can place elements in the header and footer only. You cannot place elements in the report content area because the contents of those elements would overlap report data.
You can place only one element directly in the header or footer. To place multiple elements, insert a grid, then insert the elements in the grid.
Displaying page numbers, the current date, and other text
Common header and footer information includes the page number, report-generation date, company name, author name, copyright information, and confidentiality statements.
As
Figure 20‑14 shows, BIRT Report Designer provides predefined text elements for displaying some of these common items, including the current date, page number, author name, and file name. These items are available on the palette when the master page is displayed.
Figure 20‑14 Text elements for common header and footer items
For example, the date element is a text element that contains the following dynamic value:
<VALUE-OF>new Date()</VALUE-OF>
After inserting a predefined text element in the page header or footer, you can edit the text to display different information. For example, you can edit the date element to display the date in a different format. By default, the report displays the date according to the locale that is set on the machine on which the report is generated. Use the format attribute to display the date in a custom format, as shown in the following expression:
<VALUE-OF format="MM-dd-yy">new Date()</VALUE-OF>
To display other text in the header or footer, use the other predefined text elements in the palette and edit the text content or insert a regular text or label element and type the text from scratch.
Remember, to display more than one element in the header or footer, you must first insert a grid, then insert the elements in the grid. The predefined Author#, Page#, Date# element creates a grid and three text elements, so it may be convenient to insert this element, then edit the individual text elements.
As with any text element, you can also customize the appearance of the predefined elements. For example, you can display text in a different style or color, or align text in the center or right of the page.