cancel
Showing results for 
Search instead for 
Did you mean: 

Page N of M function: Page # greater than number of pages

Former Member
0 Kudos

Hi-

I have a problem with one of my CR 2008 reports. Under the right conditions, I will get page 5 of 4 or 6 of 5 on the last page. I have a report footer section that contains a subreport. Normally when the report footer prints, it it only requires 1 page and the page numbering is fine. If the subreport is long enough to require an extra page, the Page N of M function seems to miss the last page in the calculation of number of pages.

Has anyone else seen this or have any suggestions on how to fix it?

Thanks.

Accepted Solutions (1)

Accepted Solutions (1)

Former Member
0 Kudos

Try to use special fields pagenumber and totalpagecount and place them one beside the other and see the output.

Regards,

Raghavendra

Former Member
0 Kudos

I tried that and the page numbers are consistent with the Page N of M function. Thanks for the suggestion though.

Answers (3)

Answers (3)

Former Member

I figured out what was going on. I had a page header that I only wanted to show at the end of the report (in the report footer). To do this, I had used the suppression formula to suppress the section for all but the last page, using PageNumber <> TotalPageCount for the suppression function. Unfortunately, Crystal Reports needs to know whether or not it's going to display the header in order to calculate TotalPageCount. Therefore, in order to calculate TotalPageCount, it needs to know TotalPageCount (cyclic reference).

I hope this might help someone in the future.

Former Member
0 Kudos

The page numbering is still wrong when I used the solution that I proposed.

Former Member
0 Kudos

Just an update. If I preview the report, navigate to the final page (so the page selector shows the correct pages) and then make a change to the report (like delete a text object), the page numbering is corrected when it refreshes. This is why I thought I had the solution earlier. Note that refresh (F5) will not fix the page number since the page calculation starts over.

Former Member
0 Kudos

I figured out a workaround. My report footer contains 3 sections -- a subreport in each of the first two and static text in the third. I moved the static text from the third section to the bottom of the second subreport and removed the third section. The page numbering is now correct.

I got the idea because, after some testing, I determined that the error did not occur when the section overflows on to a new page, but rather when it is just long enough to cause the third section to be printed on a new page by itself.

Thanks for the help.

Former Member
0 Kudos

Oops. I spoke too soon. The page numbering is still wrong. I think I was looking at the page counter on the page selector tool (which is correct once you navigate to the final page). Both Page N of M and Page Number / Total Pages show the wrong number of pages.