This tutorial describes how to count the number of records in a report or a group. To demonstrate this feature, we'll use a report with grouping, similar the one created in the following tutorial: Change or Apply Data Grouping to a Report.
This tutorial consists of the following sections.
Count the Number of Records in a Group
To count the number of records in a group, do the following.
-
Select the Label in the Group Footer area, and in the Property Grid, expand its Summary category.
Set the Running option to Group and the Function to Count.
The Ignore NULL values option is useful for functions like Count or Average, because the number of elements counted will depend on it.
If required, you can specify the Format String (e.g. as Units Count: {0}). Note that value formatting is applied to a summary independently of the general formatting, and has a greater priority.
Count the Number of Records in a Report
To count the number of records in a report, do the following.
-
To add a Report Footer band to your report, right-click anywhere on it, and in the invoked Context Menu, choose Insert Band | ReportFooter.
-
Then, place a Label bound to a data field onto it, and in the Property Grid, expand its Summary category.
Set the Running option to Report and Function to Count.
The Ignore NULL values option is useful for functions like Count or Average, because the number of elements counted will depend on it.
If required, you can specify the Format String (e.g. as Total Count: {0}). Note that value formatting is applied to a summary independently of the general formatting, and has a greater priority.
Get the Result
The report is now ready. Switch to the Preview Tab, and view the result.
See Also