Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Page N of M issue and difficult to ask without showing

Status
Not open for further replies.

nicatt

Programmer
Apr 2, 2001
43
US
This is a difficult issue to show in words.

(Crystal 8.5)
A report has three groups with the 'page n of m' on the page footer. Group #1 Footer is set to Free Form Placement, Suppress, New Page After, Reset Page Number After and Keep Together. We are underlaying Group Header #2 to Group Header #3 but all other sections are set up in standard configurations except Group Header #3 which is suppressed based upon a formula. All footers are suppressed, except page footer, as is the report header and detail section.

Interestingly groups are paginated as follows: First group is correctly pg 1 of 2, pg 2 of 2. Second group is pg 1 of 1, pg 2 of 452, pg 3 of 452 etc. Subsequent groups have a similar problem. Total page count is correct. We have tried a myriad number of ideas and we are able to get it to paginate correctly. But, when re-launched the same anomaly happens. There are no visible signs of extra pages, etc. We have also used just page number and total page fields, formulas, etc. It is the total page count ('M') that is incorrect on the first page of each subsequent group and not the page number ('N').

The solution which appears to be holding is to formula New Page After setting with 'not onlastrecord' to Group Footer #1. I don't understand why this would work since the issue is with the 'M' pages.

Any thoughts or other ideas or similar experiences?



 
I will check on the service pack. More correctly the version I have is 8.5.0.217 but the company controls updates, etc. I will also experiment with what happens when the page number is in the Header. What mystifies me is why I don't get an extra blank page if the 'not onlastrecord' was the problem. When you have New Page After this qualifier is needed to prevent blank pages from printing on the last page.
 
To nicatt,

Have you figure out your problem? I'm having the same issue. I'm working on a report that needs to be printed on both side of a page. So if a group only has 3 pages, a blank page will be inserted so the first page of next group will be printed on a new sheet. This part works fine for me. But the page number setting is wrong. I used Page N of M, the M shows the total page number of the report instead of the total pages of the group. Both "Reset Page Number After" and "New Page After" setting are checked in the group footer section. These 2 settings seem to have conflict with each other. They seem to cancel each other's setting. The report works fine when only one setting checked. Any idea how to work around? My Crystal Report is Version 9.
 
The solution which appears to be holding is to formula New Page After setting with 'not onlastrecord' to Group Footer #1.

This seemed to work for us. I just don't understand why :)
 
Hey guys,

I had a similar issue. And acutally found the solution here - Business Objects: Crystal Reports 1 Formulas FAQ
- Formula Help
- How to generate unique page numbering in a report
- faq767-923:)

PROBLEM
Using the built PageNumber function will consecutively number the pages.
You want to implement Page Numbering distinct for each record in sample report(where record ID is primary key).

SAMPLE REPORT
Record ID 1 (spans 2 pages)
Result from Page Number Function: Page 1, 2
Desired Result: Page 1, 2
Detail Name
Datil Address

Record ID 2 (spans 7 pages)
Result from Page Number Function: Page 3, 4, 5, 6, 7, 8, 9
Desired Result: Page 1, 2, 3, 4, 5, 6, 7
Detail Name
Detail Address

Record ID 3 (spans 3 pages)
Result from Page Number Function: Page 10, 11, 12
Desired Result: Page 1, 2, 3
Detail Name
Deatil Address

SOLUTION
Step 1: Group by Record ID

Step 2: Set Group Header to "repeat GH on each new page" (Access the option by right clicking on the group and select "Change Group".)

Step 3: Create two equations.
1. Equation 1 should be place in GH header and should be suppressed.

2. Equation 2 should be place in the Page Header. It will also work in the Group Header.

Here's the code:

Equation 1
Shared NumberVar factorPageCount;
If InRepeatedGroupHeader
then
factorPageCount:=factorPageCount
Else
factorPageCount:= PageNumber - 1

Equation 2
Shared NumberVar RecPageCount;
If InRepeatedGroupHeader
then
RecPageCount:= PageNumber - {@PageFactor}
Else
RecPageCount:= 1


Many Thanks to KenHamady.

-Sart


 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top