How to use page totals?
Page aggregate on detail data:
=PageExec("lineTotalTextBox",Sum(Fields.LineTotal))
used in Page Header or Page Footer section will return the LineTotal summary for every single page of the report. The "lineTotalTextBox" string is the Name of a TextBox located in Report’s Detail section/ Subreport ‘s Detail Section/ Table, List, Crosstab body and is bind to a DataObject which contains the referred field.
Page aggregate on summary (aggregated) data:
=PageExec("GroupFooterTotalTextBox",Avg(Fields.Total))
If the report item is located in Group Header, Group Footer sections, and Table groups the PageExec will work over the entire raw data that is bound to the group members. For example if certain group member is rendered on two pages the PageExec will work on the group member’s data no matter if it’s rendered on two or more pages. This is done to make sure that the data will be correctly calculated over the groups and no partial group member’s data is used in the aggregates.
If you need a PageExec only for the data on the page then you should use a report item located in a detail section or detail group.
The PageExec is evaluated only on the pages that have rendered the used report item. So if for any reason the used report item is not rendered on certain page the PageExec will not evaluate on that page.
It’s important to note that there is no obligation to use the same aggregate in the PageExec as the one used in the group’s report item. For instance in the groups report item you can calculate Sum but in the PageExec you can calculate Avg. This is possible because the PageExec is working on the DataObject instead over the report item values.
Just to note that we have made some additional tuning and improvements to the Page Aggregates in Internal Build 5.0.11.328. Thus our suggestion is to download and install the latest internal build if you intent to use the Page Aggregates.
Stefan’s main interests outside the .NET domain include rock music, playing the guitar and swimming.