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 John Tel on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

How 2 set two different PageNofM ?

Status
Not open for further replies.

CrystalReports9

Programmer
Jan 10, 2003
124
US
Hi,

Is there any way to have two different PageNofM on a report?

example
--------
Page Header - Page 1 of 4 (Group wise)
Page Footer - Page 1 of 72 (All pages)

Thanks in advance!

 
One method is to create a container report that has one group that includes all records. Create a formula using a recurrent field that looks like:

{table.ID} > 0

Or like:

{table.string} <> ""

Then group on this formula and choose "Repeat Group Header on Each Page". Suppress all sections except the group header, the page footer, and if you have report header fields, place them in the page header and then go to format section->page header->suppress->x+2 and enter:

Pagenumber <> 1

Insert "Page N of M" in the main report page footer.

Insert a subreport and create your report within the subreport or import your original report as an unlinked subreport and place it in the main report group header.

In the subreport, insert a second GH#1b where you will display your group #1 fields, and insert "Page N of M" in GH#1a. Be sure to have group #1 formatted to "Repeat Group Header on Each Page." Also format Group Footer #1->New Page After->x+2 with:

Not OnLastRecord

...and also format GF#1 with "Reset Page Number After."

You probably want to eliminate the borders around the subreport.

-LB
 
Lbass

I don't think you can do what you want this way....although I must confess I am not 100% sure of what you are doing here...

Using a subreport is interesting except that there are no page numbers in a subreport and if there was then you would have to have EXACTLY the same format as the main report to get an accurate accounting of a group or total report pagecount. Simply drawing all the records won't do this

I am not 100% familiar with CR9 though and perhaps page numbers are done in subreports there....but I don't think so.

CrystalReport9

Your delima is that TotalPageCount is a bit of a misnomer. It would be nice if it related to the actual total number of pages of a report...this is true if there is no reset of the pagenumber anywhere within the report but as soon as you put a "reset Pagenumber After" (say after a group footer) then it relates only to the total pages of that group and resets itself for the next value of that group.

I know of no way of grabbing the true "totalPageCount" of the overall report when there are resets within the report. As I said to Lbass above using a subreport to try and guage this cannot be done since there is no pagecount in a subreport.

Since you only have one "totalPageCount" available you are hooped...you can have a running total of pages as they are generated with individual groups having "Page N of M" but you cannot know the total report page count til the report is finished printing

Similairly you can have "Page N of M" for the total report and have a variable that is updated on each page and reset to one when a group ends and splits to a new page....but you won't know how many pages are in each group before it ends.

This latter option is as close as you'll get IMHO unless there is magic in CR9 that I am not aware of.

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Jim,

I tested this before responding, and it does work. There can be page numbers in subreports.

-LB
 
must be a CR 9 thing then

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
But there is no Page header/footer in a subreport....I confessed to not completely understanding your original post....

So please explain it again

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Hi,

Like 2 redifine my question.

Group wise set the page number like 'Page 1 of 4' in the Page Header

Irrespective of report group set the page number for the whole report like Page 1 of 72 in the Page Footer

Hope my question/post is clear and understandable.

How to make it ?



 
CrystalReports9--

My suggestion should work for you as you describe it.

Jim,

The main report page header is used as the report header, with suppression on all but the first page, because use of the report header forced the group header to appear on page 2 instead of page 1, throwing off the Page N of M in the main report.

Actually, the group in the main report does not need to be formatted to "repeat group header on each page," since there is only one group header instance for the entire report, because of the all-inclusive group field. Page N of M is displayed in the page footer.

The subreport is formatted so that there is a new page after each group #1 footer, with reset page number after selected for this footer also. Page N of M is placed in the GH#1a header (with Group #1 formatted to repeat group header on each page). The subreport is then placed in the main report group header.

The results: The page numbers based on groups appear at the top of the page, e.g., page 1 of 3, page 2 of 3, while the page footer of the main report will display page 1 of 24, page 2 of 24, etc.

-LB
 
hmmm....well I sort of tried it as I think you laid it out. But I got a Crystal error of doing something illegal.

You don't paint a great picture of what you are doing but this is what I see it as

Main report

Page header (contains the Page N of M for the report)
Group 1 header(based on the main group of the report)
Details [a subreport linked to the main report Group 1)

Page N of M in the repeated Group 1 of the subreport

Group 1 footer

It might work....but as I said...on my first attempt I did something illegal.....interesting idea

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
Jim,

You are not implementing it as I suggested. I believe I've laid out all the necessary steps already, so will not repeat it here.

-LB
 
as I said...it is not clear to me how you are doing it....

A rookie mistake on my part, I suppose.....that's ok...

Jim Broadbent

The quality of the answer is directly proportional to the quality of the problem statement!
 
just a note to try to make this one of my threads so I can find it again quickly
 
like the idea and can see possible use for me in the future so just adding myself in to find it quickly later.

Sorry for the additional entry,

Brian
 
Hi Jim Broadbent

I am using CR9. Its just the single report. no subrepot merged.

Page 1 of 4 (Group wise) -- Its Solved.
Total Pages 40 (Whole Report) -- Its not Solved

i used the option 'reset page number after' in the 'section expert' for the group footer(say municipal no).

place the 'Page N of M' in the 'Page hearder'. Now i can get the Group wise page numbers like page 1 of 4, page 1 of 2....

Issue
-----------
Not getting the "Total Number of Pages" for the whole report.

Sorry for my late response.
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top