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.

  1. Create a new report or open an existing one.
  2. Add a Report Footer band to a report.
    To do this, right-click anywhere over the report's area and click Insert Band > ReportFooter.
  3. In the same manner, add GroupHeader and GroupFooter bands to the report.
  4. Drag the required data fields from the Field List onto the report bands.

    Count records

  5. 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.
    Count records
  6. In the same way, create a copy of this field in the Report Footer area to display the number of records for the report.
  7. Click the Smart tag of the GroupHeader1 band, and in the invoked actions list, click the browse button (...) in the Group Fields box.
    Count records
    This opens the GroupField Collection Editor dialog box.
  8. Click the Add button to add a new grouping field, set its FieldName property to the required field, and click OK.
  9. Select the Label in the Group Footer area, and in the Property Grid, expand the Summary property.
    Count records
  10. Set the Summary property values for the Group Footer as follows:
    PropertyValue
    Running Group
    Function Count
    Ignore Null Values Yes
    Format String Products in the Group: {0}
  11. Similarly, select the Label in the Report Footer area, and in the Property Grid, expand the Summary property.
    Count records
  12. Set the Summary property values for the Report Footer as follows:
    PropertyValue
    Running Report
    Function Count
    Ignore Null Values Yes
    Format String Products in the Report: {0}
  13. The report is now ready. Switch to the Preview tab and view the result.