Setting the length of a page number

Use properties to change the default length of a Page Number container and ensure that enough space is available to display the page number string.

For performance and latency reasons, the Genero Report Engine (GRE) lays out the pages of the report without waiting to know the total number of pages. Instead, when the GRE has acquired all other information for the page, it computes the layout and allocates a default size of four digits for the page number string. This length is sufficient for most needs, but in some cases you might want to change the default:

  • If the report exceeds 9999 pages, the default size will not be large enough for the actual text.
  • If the report does not exceed 100 pages, you might want to minimize the space it occupies.

For these cases, you can set the allocated size of the Page Number container by setting one or more of the following properties:

  1. X-Size: Set the length explicitly, for example, 3cm.
  2. Text: Set to the maximum number of digits you want. For example, set Text to 000 to specify a maximum length of three digits.
  3. Text Expression: Set the PXML string expression value. See Using a page number string.
  4. Code Value Expression: Set the PXML string expression value for the bar code.

If multiple sizing properties are configured, Genero Report Writer uses the property with the highest priority (listed above from highest to lowest priority).

If none of these properties are set, Genero Report Writer calculates the length of the Page Number container to contain a maximum of four digits.