I'm creating an invoice report that sometimes requires a group to continue for multiple pages.
Is there a way within Report Designer to create a group-based page counter?
For example:
A report is 30 pages long but is split and page broken by a group.
The page counter for each grouping should display the current page, along with the number of pages for that specific group. Something like "Page 2 of 4"
Thanks! -Eric
5 Answers, 1 is accepted
Group-based page numbering is not supported out-of-the-box.
If you use Standalone Designer to create TRDX|TRPD reports the designer needs to be extended with additional logic for resetting the page number per group (check the attached example).
After the Designer is extended to use the external assembly with user function, you can use this function inside the reports to reset the page number per group.
You can also check How to use external assemblies with custom user functions in the Report Designer KB article providing more detailed information on how to extend the Designer.
Regards,
Katia
Telerik by Progress

Hi,
Isn't there a way to do it in the report designer?

There sure is.
= "Page: " + PageNumber("group1", Fields.salesorderID) + " of " + PageCount("group1", Fields.SalesorderID)
That is the expression that I use in my reports.
So typically you would drop this in the page footer as a text box.
Group1 = what ever the name of your group is that you are grouping the invoice on.
SalesOrderID = this is my transactionID from my database. You will need to change this to suit your database.
Let me know how you make out as it took me a while to figure this one out.

Hello Katia,
How to Implement Reset PageCount per Report Group, like extended custom user functions "MyPageCount" ?
Hello Ted,
Since R1 2017 (version 11.0.17.118), we introduced advanced built-in PageNumber and PageCount functions allowing to reset the page number and count on any page based on the data. For more information, refer to Page Functions article.
If you prefer not to upgrade, you can check the sample report provided by Katia which works for the older versions of Telerik Reporting too.
Regards,
Neli
Progress Telerik
This comment applies to R3 2021 SP2 (version 15.2.21.1125)
While the PageNumber and PageCount functions are working great in the Page Header/Footer sections, they seem to return blank values when used in a Group Footer section.
My specific need is to be able to determine when a Group Footer section, set to PrintOnEveryPage=True, is occurring on the last page of the group.
Specifically: On my Invoice Report, which can be run for multiple invoices, I want the totals for all the line items on a given invoice, to only show up in the footer of the last page for that particular invoice. NOTE: There is other information in the group footer that is supposed to show up at the bottom of every page and each Invoice can have enough line items on it to require 1 to 100 pages.
If the PageNumber and PageCount functions can't be used to determine if the group footer is occurring on the last page of the group, is there another way?
Hi Sam,
There is a feature request for this requirement - Access the PageNumber from Report/Group header/footer sections. and I have voted for it on your behalf. In this way, you increase its priority and you will receive a notification when there is update on the status.
Currently, the page functions are available only in the page sections. For that reason, I am afraid that there is no workaround that I can suggest.
Please, let me know if you have further questions.
Thanks for the link to the feature request, I'll keep an eye on it.
By "no workaround", do you mean there is currently no way to determine if a group header/footer is occurring on the last page of the group? (I was really hoping for an alternative I wasn't aware of)
Hi Sam,
Maybe you can test using a table. When you add the group of the table, please, make sure that you check the Add Footer option. Please, check the attached sample report.
As far as I know, putting the invoice totals in the detail grid table will cause them to appear immediately after the last line item for that invoice... instead of at the bottom of the page. Is there some way to force the last row of a detail grid to appear at an arbitrary position on the page?
Hi Sam,
You may test using the Exec Data function which allows you to execute the specified expression in the given parent data scope. Also, you can consider sending me screenshots of the desired outcome. There might be another approach that we could suggest.