Print a layout-dependent reference (Info Nodes)
Use Info Nodes to print a value on the report that depends on the paged stream resulting from the report layout.
For example, a value for "total from previous page" can vary depending on how the page options for a report are set. For a report layout that works with various page sizes, you can use an Info Node and a Reference Box.
This example illustrates how to print the total price (overalltotal
) from a
previous page.
In the report program
The report application must calculate the desired value and output it to the report. For example,
you can create a variable named overalltotal
to accumulate and hold the running
total price of the line items of a report.
In the report design document (.4rp)
Use these objects from the Toolbox in your report design:
- Info Node - place this object in the container for the ON EVERY ROW
trigger of your Structure view. This creates an invisible column in
your report line containing the value of the Info Node.
The Value property of the Info Node must be a String.
You can use the format method of the Numeric class to convert to a string and also specify the format, as in this example:overalltotal.format("-,---,---,--&.&&")
- Reference Box - place this object in the page
header at the top of the report structure.
- For the InfoNode Name property, enter the name of the Info Node that you created.
- For the Text property, enter a string used to determine the maximum length of the value in the Info Node, because the value will not be known at the time the Reference Box is positioned. Examples: Enter 000,000.00 as the maximum length for a value from a numeric data type, or MMMM as the maximum length for a value from a CHAR(4) data type.
- Word Box - optionally use this object to add some text next to the Reference Box.
A Reference Box points to the immediately previous occurrence of the Info Node value in the paged stream. Because you placed the Reference Box in a Page Header, it will point to the last occurrence of the overalltotal value on the previous page.