computed_field_quantity_page_total computed_field_quantity_report_total

 

The sample project Chapter13_ComputedFields.pnj contains a report called Report1 that includes two computed fields: QuantityPageTotal and QuantityReportTotal. You can locate this sample in the \userguide\samples folder under the PEERNET Reports installation directory.

 

In this report, the QuantityPageTotal computed field is attached to Text Field 2, which contains the words Quantity1 as the sample value:

 

computed_field_quantity_page_total_properties_1 computed_field_quantity_page_total_properties_2

 

This computed field has been set up to calculate the total of all the Quantity fields on each individual page of the report (by using Sum as the Operation value, and Page as the Over value). So, for example, if the first page of the report contains four records whose Quantity fields are 1, 2, 10, and 5, the Text Field attached to the QuantityPageTotal computed field will display 18 on the first page of the report. If the second page of the report contains four records whose Quantity fields are 1, 1, 1, and 1, the Text Field attached to the QuantityPageTotal computed field will display 4 on the second page of the report. This is repeated for all pages of the report.

 

The QuantityReportTotal computed field is attached to Text Field 4, which contains the words Quantity2 as the sample value:

 

computed_field_quantity_report_total_properties_1 computed_field_quantity_report_total_properties_2

 

This computed field has been set up to calculate the total of all the Quantity fields on the entire report (by using Sum as the Operation value, and Report as the Over value). Therefore, the Text Field attached to this computed field will display the same total on each page of the report.

 

When you select the Print Preview command, the report is previewed. The bottom of the first page of the previewed sample report is shown below:

 

computed_field_report_print_preview

 

The value calculated for QuantityPageTotal appears in place of the word Quantity1 in Text Field 2 in the footer of each page of the report. This value is different on each page. The value calculated for QuantityReportTotal appears in place of the word Quantity2 in Text Field 4 in the footer of each page of the report. This value is the same on each page.