1

I am developing an window application where i need to get total pages in Rdlc report viewer.

So please tell me how to get total page count.

Here is my Code, which is not working and always show 0 :

Dim TotalPage As Integer = ReportViewer1.LocalReport.GetTotalPages(PageCountMode.Actual)
MsgBox(TotalPageAs)

enter image description here

In this image total number of page is 6 .

NorCode
  • 679
  • 1
  • 12
  • 33
  • Typically, you need to produce the pages to know how many there will be. At least run through the pagination logic to get a count. Perhaps a simulated print cycle to get a count, prior to actually producing the preview? – DonBoitnott Aug 14 '14 at 11:29

1 Answers1

1

Try using the ServerReport and not the LocalReport, as shown here:

ReportViewer.ServerReport.GetTotalPages() 

For more information, take a look here and here.

Eminem
  • 870
  • 5
  • 20