How to Customize Page Numbering Options in a .NET Report
| Quick Start Guide | |
|---|---|
| What You Will Need |
ActiveReports.NET Visual Studio |
| Controls Referenced | |
| Tutorial Concept | In this tutorial, you will learn how to customize page numbering behavior in ActiveReports.NET to improve the readability of multi-page reports. You’ll see how to implement page numbering logic using scripts in Section Reports and properties and expressions in Page and RDL Reports. |
Page numbering may seem like a simple detail, but in many real-world reporting scenarios, it plays an important role in improving readability and organization. When reports include grouped data or span multiple pages, developers often need more control over how page numbers appear, such as resetting numbering per group or displaying special messages on the last page of a section. In this tutorial, you’ll learn how to customize page numbering in ActiveReports.NET, including how to generate page numbers based on groups and display a custom message on the final page of each group using the appropriate controls, properties, and expressions for different report types.
Want to Test It Out? Download ActiveReports.NET Today!
Let's create a report listing the available and discontinued products based on Northwind's Products table. The report will be grouped by the Discontinued field in the table, spanning different page counts.
Once we group our data, assuming that Group1 will fit on one page and Group2 will span three pages, the numbering for the first page of the Report would be 1 of 1. The counter would be reset, and the numbering for the second Group would now be printed as 1 of 3, 2 of 3, 3 of 3.

The approach for customizing page numbering in ActiveReports.NET varies depending on the report type you are working with. Section Reports rely on code-based logic, so page numbering behaviors such as resetting counts or detecting the final page of a group are typically implemented using scripts and event handlers within the report’s code. In contrast, Page Reports and RDL Reports use a layout-driven model, where these behaviors can be configured through report properties and expressions directly within the designer. This distinction allows developers to either implement precise programmatic control in Section Reports or leverage the built-in declarative features in Page and RDL reports for easier configuration.
Section Reports
Display Page Numbers on the Basis of Groups
The solution is simple. Use ReportInfo Control to show page numbering based on groups, and set its properties as follows:
- Format: Page {PageNumber} of {PageCount}
- SummaryGroup: GroupHeader1
- SummaryRunning: Group
That's it, and you are good to go!
Display Custom Message on Last Page
You may want to display page numbers for each group while showing a Custom Message on the last page of the group. In this case, you need to perform one extra step. Once the ReportInfo Control has been added and its properties set as mentioned above, drag and drop a TextBox Control from the toolbox.
Place this control exactly over the ReportInfo Control and set its Visible property to False. We will use the TextBox Control to show a custom message. Toggle the visibility of these two controls, ReportInfo and TextBox, in the Format event of GroupHeader and GroupFooter to get the desired results. Use a script like the one below:
Sub GroupFooter1_Format
ReportInfo1.Visible = false
TextBox3.Visible = True
TextBox3.text = "This is the last page of this group."
End Sub
Sub GroupHeader1_Format
ReportInfo1.Visible = true
TextBox3.Visible = false
End Sub
Once implemented, the report generates the following result:

Page and RDL Reports
Display Page Numbers on the Basis of Groups
This solution is even simpler. Use the predefined Page N of M (Section) expression from the Common Values found in the Report Explorer panel to show page numbering-based groups. Just remember that when you create your grouping in your report, you check the Has own page numbering setting for the group's layout:

Display Custom Message on Last Page
To display a Custom Message on the last page of the group while keeping the page numbering as discussed above, you can use an Expression. Select the Page N of M (Section) textbox and change its expression value to:
=IIF(Globals!PageNumberInSection = Globals!TotalPagesInSection, "Page " & Globals!PageNumberInSection & " of " & Globals!TotalPagesInSection & ". This is the last page of this group. ", "Page " & Globals!PageNumberInSection & " of " & Globals!TotalPagesInSection)
This expression states that if the current page is the last, append 'This is the last page of this group.' to the page numbering. Otherwise, leave it as Page N of M. With that, this is the result we get:

Conclusion
Custom page numbering is a small feature that can significantly improve the usability of your reports. By configuring the ReportInfo control, leveraging group-based page numbering, and using expressions or script logic, you can tailor how page numbers behave in Section, Page, or RDL reports. With these techniques, your .NET reports can present grouped data more clearly and provide helpful context to end users, making multi-page reports easier to navigate and understand.
To see the complete implementation, download the zip file here: CustomPageNumbering.zip
Learn more about ActiveReports.NET features by visiting our Online Demos.
Want to Test It Out? Download ActiveReports.NET Today!