To calculate summaries (totals) within a report, follow the instructions below.
-
If the Report Footerband is not present in your report, add it. To do this, right-click anywhere over the report's area and in the invoked Context Menu, select Insert Band| ReportFooter.
-
Click the field for which a summary will be calculated, to select it. Then, hold down CTRL and drag the field onto the Report Footer area, to create an exact copy of the Labelthat will display the summary.
Note You can also create a new label for your total by simply dragging it from the Control Toolbox.
-
Now, select the newly created Label, and in the Property Grid, locate the Summaryproperty and click its ellipsis button. The Summary Editorwill appear.
The following image shows an example of how you can set up your total. Note that the Summary Running option is set to Report, to ensure that all values from the specified data field are taken into account.
Note The Ignore NULL valuesoption won't affect the result in this example, since NULL values are treated like zeros, by default. So, Sum won't change whether these values are taken into account or not. This option makes sense for functions like Count or Average, because the number of elements counted will depend on it.
To save the settings and close the dialog, click OK.
Switch to the Preview Tab, and view the result.
See Also