Performing aggregate (summary) calculations
You can perform aggregate calculations (sum, minimum, maximum, count, average, standard deviation, variance) on fields within groups in a report and for the report as a whole.
To do aggregate calculations you must first specify a group of fields on which to perform the summary operation (unless you are summarizing data for the entire report).
To perform an aggregate operation,
Choose Layout|Add Groups And Summaries
On the Group page of the dialog box, select the field or fields on which you want to group the data. If you are going to do only a grand summary over the entire report (such as a grand total), then skip this step.
Click the Summaries tab of the dialog box.
From the Group drop-down list, select the group on which you want to perform an aggregate operation. (Grand Summary is always available.)
From the Available Fields list, select the field on which you want to perform the operation.
From the Available Aggregates drop-down list, select an operation.
Click the arrow button to move the field and its operation to the Summary list.
Repeat for as many fields as you want.
If you want to change the aggregate summary operation for a field already in the Summary box, select that field in the Summary box and use the drop-down list below it to select a new operation.
If you need very sophisticated calculations beyond the operations offered in the Available Aggregates box, you could also create summary calculations in fields by writing methods for their events. Select the object linked to the field, and type your code into one of its report-specific events, such as
onDesignOpen, activated on opening a report
preRender, activated before a report runs
canRender, activated before a component is rendered, to determine whether the component will be displayed.