Print a Layout-dependent reference (InfoNodes)

InfoNodes allow you 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. In order to have a report layout that will work with various page sizes, you can use an InfoNode and a Reference Box.

This example illustrates how to print the total price (overalltotal) from a previous page.

In the Genero BDL report program

The REPORT block of the Genero BDL file must calculate the desired value and output it to the report. The following example is from the OrderReport.4gl file in the demo sample programs:
ON EVERY ROW
  LET lineitemprice = orderline.lineitem.unitprice * orderline.lineitem.quantity 
  LET overalltotal = overalltotal + lineitemprice 
  LET ordertotal = ordertotal + lineitemprice 
  PRINT orderline.*, lineitemprice, overalltotal, ordertotal

The variable overalltotal contains the running total price of the lineitems on the report.

In the Java, C# or PHP 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)

You will use these objects from the Toolbox in your report design:

A Reference Box points to the immediately previous occurrence of the InfoNode 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.