Using "Page N of M"

For PageNumber Boxes, you can use the textExpression property to calculate a page number string, for example to print "Page N of M". If you set the textExpression property, the values of the pageName, pageNoOffset, and pageNoFormat properties are irrelevant; however, the text property is still used to indicate the maximum length. Beginning with version 2.4x, pages using "Page N of M" no longer causes latency; they will be streamed,

This same functionality is available for BarCode Boxes, using the property codeValueExpression.

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

Effect on latency

Using the function getTotalNumberOfPhysicalPages causes the output of the report to be delayed until the entire input has been read. The use of the function getTotalNumberOfPages delays the output until all material for the node named by "nodeName" has been produced. Using any of the other functions has no impact on the streaming (causes no latency).

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)