Count the Number of Groups in a Report
- 2 minutes to read
Online Example: How to count the number of groups in a report
This tutorial demonstrates how to count the number of groups in a report using the DCount summary function. This function counts the number of unique records in the defined data field.
See Count the Number of Groups in a Report to learn about the alternative approach to solving this task.
See Data Binding Modes to learn more about the available binding modes.
The following image illustrates the report created in this tutorial:
Do the following to count the number of groups in a report:
- Start with the report created in the Group and Sort a Report's Data tutorial.
Add the Report Footer band to display the number of groups at the bottom of the report. Right-click anywhere on the report designer, and in the context menu, select Insert Band and then ReportFooter.
Copy the label from the Group Header to the Report Footer by dragging this label while pressing the CTRL key.
Select the created label and click its smart tag. In the invoked actions list, set the Summary Running property (XRSummary.Running) to Report to calculate a summary for the entire report.