In Dynamics NAV 2013 R2 it is now possible, again, to implement Page X of Y for document reports.

PageXofY

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

PageXofY2

To do this follow these steps:

  1. select the List control in the body of your document report
  2. select the group in the Row Groups window
  3. open the Properties
  4. 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:

PageXofY3

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?

For a video demonstration on this topic please have a look here.

 

Leave a Reply

Post Navigation