Total page number

When report consist of several pages (e.g. 7) on the top of the screen there are buttons to navigate to next page and previous page. Between them there is an input box with current page number and after slash there should be total page number. But when report is created instead of total_page_number there is current_page+ number (i.e. 1/1+). When you go to next page it changes to 2/2+ until you get to the last page. After that if you go back to some intermediate page total_page_number displayed correctly. Does anybody know how to display the correct page number from the beginning?


Jedi (BOB member since 2011-01-18)

In the toolbar you can’t.
You can only do it if you display the Page N of M on the report itself.

There is a good reason that it does this. It’s because when you view a Crystal Report, it actually just serves up to the client the first page. At that point it will say 1+. At this point it doesn’t know how many pages there are because you’ve only asked for the 1st page. It only knows how many pages there are when it gets there.
This is by design because imagine you had a 1000 page report, when you view the Crystal Report, CR has the good sense to know that you are only viewing the 1st page initially so that’s all it sends to you. It’s broken the 1000 pages into 1000 smaller manageable chunks and then sends them only if you need them. This results in far faster response times for the end user.

Note that the Page N of M function in Crystal Reports is not really recommended even though I know everyone likes to see it. The reason it isn’t is for the same reasons above. If you insist on knowing the total pages then every time any user views the report, you’ll have to wait until crsytal loops through all the pages in order to find out what the answer is rather than just being able to send you the 1st page.


chesl73 (BOB member since 2008-05-15)