4.8.2 Adding Page Numbers and Dates in Headers/Footers
Note: The final page count of a report depends on several factors, including current records in the database and any end-user parameter selections.
To insert page numbers or current date/time into a report, use the special page number and time/date tags ({P},{N},{D},{T}) within a Text element. In general, this is much more reliable and robust than hard-coding these values into the report template itself.
The following table lists the special tags with their complete syntax:
Table 2. Header and Footer Tags (Page Numbers, Date/Time)
Tag |
Description |
{P} |
Page number |
{P,format} |
Page number and number format (java.text.MessageFormat) |
{N} |
Number of pages |
{N,format} |
Number of pages and number format (java.text.MessageFormat) |
{D} |
Generation date |
{D,format} |
Date and format (java.text.SimpleDateFormat) |
{T} |
Generation time |
{T,format} |
Generation time and format (java.text.SimpleDateFormat) |
To edit a Text element that contains these special tags, use one of the regular methods for editing text:
• Right-click the Text element, and select 'Edit' from the context menu.
• Right-click the Text element, and select 'Properties' from the context menu (or double-click the Text element) to open the 'Properties' dialog box. Select the Contents tab, and edit the contents as desired.
These special tags for page number and date/time are only effective when used within headers and footer Text (or Textbox) elements. If you use these tags within any other report element or in the report body, the runtime substitution is not performed. However, you can insert runtime page-numbering and date/time information into other elements or the report body by using script. For more information, see the onPageBreak Handler section the Report Scripting, as well as Appendix JS.7.1, Date and Time Functions.
| << 4.8.1 Adding Headers and Footers to a Report | © 1996-2013 InetSoft Technology Corporation (v11.5) | 4.8.3 Displaying a Header/Footer for Specific Page Types >> |