Wednesday, October 17, 2012

Simple page number field in AX 2012 SSRS report

When developing AX 2012 reports in Visual Studio you might want to add a simple page counter field that shows both the current page number and the total number of pages and is prepared for any language.

Looking at the SalesInvoice report, the page numbering is done using four fields:

Copying this to another report/layout will require some adjusting, since the information is split up into four fields. Also, if you are (for some reason) printing thousands of pages, you might need to adjust the field widths.

To add a simple page numbering field to your report, create a new placeholder in a field and set the value expression to:

=Labels!@SYS7426 + " " + CStr(Globals!PageNumber) + " " + Labels!@SYS70751 + " " + CStr(Globals!TotalPages)

This will produce an output like this:

1 comment:

  1. how to reset pagenumber if group changes in the report. it should reset to 1 and also total pages should also reset.

    ReplyDelete