Display Row Numbers in a Report, Group or Page

  • 2 min to read

This tutorial describes how to show the current row number in a data-aware report.


This approach to displaying row numbers can be used when the UserDesignerOptions.DataBindingMode is set to DataBindingMode.Bindings.

See Display Row Numbers in a Report, Group or Page to learn about an alternative way of displaying row numbers in a report.

See Data Binding Modes to learn more about the available binding modes.

The following image illustrates the report created in this tutorial.

HowTo - ShowTheCurrentRowIndex_2

Do the following to display the current row numbers in a report

  1. Start with a report that is bound to the sample Northwind database's CategoryProducts view (the nwind.mdb file included in the XtraReports installation). See Provide Data to Reports to learn more about binding a report to a data source.
  2. Drop the ProductName data field from the Field List onto the report's Detail band.

    HowTo - ShowTheCurrentRowIndex

  3. Click the field for which the current row index should be displayed to select it. Hold down CTRL and drag the field to create an exact XRLabel control's copy used to display the index.

    HowTo - ShowTheCurrentRowIndex_0

  4. Click the created label's smart tag, and in its actions list, set the Summary Running property (XRSummary.Running) to Report (Group or Page if required).

    Set the Summary Func (XRSummary.Func) to RecordNumber and define a format string (XRControl.TextFormatString).

    HowTo - ShowTheCurrentRowIndex_1