Count the Number of Records in a Report or a Group

<< Click to Display Table of Contents >>

Navigation:  User Interface Reference > Report Designer > Report Designer for WinForms > Create Reports > Miscellaneous >

Count the Number of Records in a Report or a Group

Interface Elements for Desktop > Report Designer > Report Designer for WinForms > Create Reports > Miscellaneous Report Management Capabilities > Count the Number of Records in a Report or a Group

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

Count the Number of Records in a Report

Get the Result

ExpandedCollapsed 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.

img8540

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.

ExpandedCollapsed Count the Number of Records in a Report

To count the number of records in a report, do the following.

1.To add a Report Footer band to your report, right-click anywhere on it, and in the invoked Context Menu, choose Insert Band | ReportFooter.

img11132

2.Then, place a Label bound to a data field onto it, and in the Property Grid, expand its Summary category.

img8541

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.

ExpandedCollapsed Get the Result

The report is now ready. Switch to the Preview Tab, and view the result.

img8542

ExpandedCollapsed See Also

Show the Current Row Index

Limit the Number of Records per Page

Cancel Printing If a Report Does Not Contain Any Records

Add Page Numbers for Groups

Copyright (c) 1998-2016 Developer Express Inc. All rights reserved.

Send Feedback on this topic to DevExpress.