cancel
Showing results for 
Search instead for 
Did you mean: 

Knowing Viewer Page Count in Windows Forms

Former Member
0 Kudos

How do I determine the total Page Count of the Document in the Viewer?

Due to performance problems, I am breaking my report into 'Groups'. My Selection Formula is selecting the records for the group. I have created my own toolbar to move from page to page, but I don't know how many pages are in a group. Therefore, somehow I need to get the info from the viewer.

Say my group has 10 pages. I capture the CRViewer.Navigate event and see as I page through the NewPageNumber cycles through until is goes to 11, which is beyond my page count. The ShowNextPage event acts as if nothing is wrong, and shows me page 10 again!

I've looked through all the help files and only find a way to do this via the Web Viewer, which doesn't do me much good!

Suggestions please!

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Hello Steven,

what happens if you use the ShowLastPage() method ?

[Visual Basic] 
myCrystalReportViewer.ShowLastPage() 
[C#] 
crystalReportViewer.ShowLastPage() ;

If it will not display the page 11 then I would doublecheck how many pages this report displays in the CR Designer.

Falk

Former Member
0 Kudos

Obviously if I show the last page, I can get the count.

I want to know the count before doing any paging!

I rewrote the app to do this in the app prior to calling Crystal, so this is not really an issue. However, since my users modify their forms and potentially change the number of lines per page, it may be a problem downstream.

It just seems that the Viewer is VERY limited in giving a developer the info they need to work with it.

former_member184995
Active Contributor
0 Kudos

Here is a kbase that shows how to get the number of pages from a Report Document:

[Number of Pages|https://www.sdn.sap.com/irj/servlet/prt/portal/prtroot/com.sap.km.cm.docs/oss_notes/sdn_oss_boj_erq/sap(bD1lbiZjPTAwMQ==)/bc/bsp/spn/scn_bosap/notes.do]

Jason

Answers (0)