Count the number of records in a report or group
Perform this procedure to count the number of records in a report or a group.
- Create a new report or open an existing one.
-
Add a Report Footer band to a report.
To do this, right-click anywhere over the report's area and click.
- In the same manner, add GroupHeader and GroupFooter bands to the report.
-
Drag the required data fields from the Field List onto the
report bands.
-
To create an exact copy of the Label that will display the number of records
for a group, press Ctrl while you drag the field for which the number of records
will be calculated onto the Group Footer area.
- In the same way, create a copy of this field in the Report Footer area to display the number of records for the report.
-
Click the Smart tag of the GroupHeader1 band, and in the
invoked actions list, click the browse button (...) in
the Group Fields box.
This opens the GroupField Collection Editor dialog box.
- Click the Add button to add a new grouping field, set its FieldName property to the required field, and click OK.
-
Select the Label in the Group Footer area, and in the Property
Grid, expand the Summary property.
-
Set the Summary property values for the Group Footer as
follows:
Property Value Running Group Function Count Ignore Null Values Yes Format String Products in the Group: {0} -
Similarly, select the Label in the Report Footer area, and in the
Property Grid, expand the
Summary property.
-
Set the Summary property values for the Report Footer as
follows:
Property Value Running Report Function Count Ignore Null Values Yes Format String Products in the Report: {0} - The report is now ready. Switch to the Preview tab and view the result.