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

Include suppressed pages in page numbering

Status
Not open for further replies.

MEDL2002

Programmer
Jul 16, 2012
6
CA
Hello there,

I’ve got the following requirement and I’m not sure if/how this can be accomplished in Crystal.

I have 3 versions of one report – the same .rpt file is used and its parts are suppressed based on the value in one of the data fields (report_type field). So let’s say the report has three pages: 1st page shows customer’s address, letter body, etc., 2nd page shows a detailed purchase transactions and 3rd page shows some “additional” information. Report’s pages are numbered 1 through 3.

When a user select an option to print the 2nd page only (report_type field has value 2) – the 1st and 3rd pages get suppressed and only 2nd page gets printed. The user wants to see “Page 2 of 3” printed in the page footer, and not “Page 1 of 1” (the way it is right now). Similarity, when they want to print 3rd page only, they want to see “Page 3 of 3” printed in the page footer.

The PageNofM function is used to determine the page number as compared to the total number of pages, at print time. Because certain pages are suppressed at print time, the PageNofM function is not able to determine what would have been the total number of pages if the report hadn’t been suppressed.

Please note that users do not want to run the “complete” report, go to print options and select pages they need to print so that the pages are numbered the way described above.

Any help would be greatly appreciated.
MEDL
 
If there are always 3 pages you can replace the Page NofM with text formula

Assuming you are using a parameter

If Parameter = ReportType1 then 'Page 1 of 3' else
If Parameter = ReportType2 then 'Page 2 of 3' else
If Parameter = ReportType3 then 'Page 3 of 3' else
'Page '&totext(pagenumber, 0)&' of '&totext(totalpagecount, 0)

If page count can vary then what you want to do will be impossible.

Ian

 
Hi Ian,
Thank you for your input. Unfortunately, the page count can vary, I just gave the 3 page example to make it simple.
As you said, I don't think what the users expect is possible. I just wanted to confirm it.
I was also thinking that they could pass starting page and total number of pages as paramters but I don't think they would like that idea either. That would mean that they would have to know the page count from the complete report, so they may as well run the complete and go to print options.
Again, thank you for taking the time to respond to my post.
Milena
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top