In Dynamics NAV 2013 R2 it is now possible, again, to implement Page X of Y for document reports.
In previous versions of RDLC the problem was that in a typical document report the content of the body was put in a List container to implement the Number Of Copies option. Via the List we then grouped the Body on the OutputNo variable. To be able to calculate the page number we then had to use complex expressions because of the fact that we had to reset it for every new copy. And there was no solution to calculate and reset the total pages.
In RDLC 2010 there is a simple solution. Let’s he how it works.
Basically we will be using a new property introduced in RDLC 2010 in the group properties of a List data region: ResetPageNumber
To do this follow these steps:
- select the List control in the body of your document report
- select the group in the Row Groups window
- open the Properties
- enable ResetPageNumber.
This means that when the group encounters a new OutPutNo it will reset the page numbers (PageNumber and TotalPages).
Then you can just use these in the Header of the report as shown here:
In this example we are using a replace function to replace the placeholders %1 and %2 in the PageCaption and show the result.
And voila, you’re done.
Nice, isn’t it?