D365 SSRS sample code – Displaying page number on the body of the report

By default, SSRS does not allow you to display global variables such as page number on the body of the report. They can only be used in the header or footer section of the report.

If you want to display the page on the body of the report, you can use this code. Add the code below to the code section of the SSRS report

Function PageNumber() As String
Return Me.Report.Globals!PageNumber
End Function

Function TotalPages() As String
Return Me.Report.Globals!TotalPages
End Function

Leave a comment