Calculate a Summary
- 2 min to read
This tutorial describes the steps required to calculate one of the built-in summary functions in your report.
See Calculate a Summary to learn about the alternative approach to calculating summaries.
See Data Binding Modes to learn more about the available binding modes.
The report created in this topic displays the total number of ordered units:
Do the following to calculate a summary function in your report:
Start with a report that is bound to the sample Northwind database's "Products" table (the nwind.mdb file included in the XtraReports installation). See Provide Data to Reports to learn more about binding a report to a data source. This tutorial starts with the following report layout:
Add the Report Footer band to display a summary at the bottom of the report.
- Drop the UnitsOnOrder field from the Field List onto the created band.
Click the label's smart tag, and in its actions list, set the Summary Running property (XRSummary.Running) to Report to calculate the summary for the entire report.
Set the Summary Func (XRSummary.Func) to Sum. In addition to a simple summary, you can choose among numerous built-in functions (see the Expression Constants, Operators, and Functions topic to learn more).
Enable the XRSummary.IgnoreNullValues option in the Property Grid if a data source contains such records and they should not affect the sum.