Using a page number string

For Page Number containers, use the Text Expression property to create a page number string, such as the standard "Page N of M".

If you set the Text Expression (textExpression) property, it's important to verify that the Page Number container length is long enough to print the full page number text. The size of the string depends in part on the number of page breaks in the report. For example, the string "Page 2 of 5" has a smaller length than "Page 2 of 76".

Because of the unpredictable variation in size, Genero Report Writer defaults to a container size based on a four digit current page and total number of pages (i.e. "Page 9999 of 9999"). To override the default behavior you can set the X-Size to an explicit size or hint a smaller size with the Text property (e.g. "Page 99 of 99").

The values of the Name (pageName), Offset (pageNoOffset), and Format (pageNoFormat) properties are ignored when the Text Expression property is set.

These functions can be used to format and access specific page numbers and totals.

Examples

This expression computes the string "Page N of M" for the physical pages. The equivalent of the "Offset" property can be achieved by doing arithmetic with the results from the page number functions. In this case, the numbering will start at page 11 since the example formula adds 10 to the value returned from the function getPhysicalPageNumber.

"Page "+format(getPhysicalPageNumber(),ARABIC)+" of "+format(getTotalNumberOfPhysicalPages(),ARABIC)

This expression computes the string "Page N of M" for logical pages, providing page numbers for each order within a batch of several orders.

"Page "+format(getPageNumber("pageRoot"),ARABIC)+" of "+format(getTotalNumberOfPages("pageRoot"),ARABIC)