?
Solved

Printing total page count on subreport pages in a main report

Posted on 2010-03-30
9
Medium Priority
?
1,048 Views
Last Modified: 2013-11-15
I have several multipage sub reports I inserted into separate report heading sections of the main report.  These must be in separate sections beacuse some sub reports are profile orientation and some are landscape orientation.
I need to display the page number and total number of pages at the bottom of each page.

I  am able to do this sucessfully with the page number. I have a shared variable for page number I set this shared variable equal to the PageNumber in the main report before inserting the subreport. In the subreport I add the subreport PageNumber to this shared variable before displaying it at the bottom of the page of the subreport.

I tried a similar method using a shared variable for TotalPageCount. In the main report I set this varialble equal to the TotalPageCount prior to inserting the subreport. When I display this shared variable at the bottom of the page of the subreport it shows the correct number of pages on page 1 but on page 2 it displays an unintialized number 4,294,96....
I do not understand why my method is OK for page number but not page count?
0
Comment
Question by:Brad_Shillito
  • 4
  • 3
  • 2
9 Comments
 
LVL 101

Expert Comment

by:mlmcc
ID: 29103044
The page number is known when you generate the subreport.  However the total page count isn't known until the entire report is rendered.  Try moving to the last page of the report then back to the first and see if the page numbering works.

mlmcc
0
 
LVL 14

Expert Comment

by:LinInDenver
ID: 29104717
When I have sub reports and require page numbers, I actually put the N of M in my Main report page footer, rather than in the sub report.

Depending on what you are doing exactly, this might work for you too.

0
 

Author Comment

by:Brad_Shillito
ID: 29122065
LininDenver
Because I have my SubReports in Separate Page Header sections,
Placing the N of M in the page footer only prints on the last page.

What section do you have your sub reports inserted when you get this to work?
Do you have multiple pages in your sub reports?
0
Receive 1:1 tech help

Solve your biggest tech problems alongside global tech experts with 1:1 help.

 

Author Comment

by:Brad_Shillito
ID: 29122262
mimcc
I am not sure what you mean by
"Try moving to the last page of the report then back to the first and see if the page numbering works"
.
0
 
LVL 14

Accepted Solution

by:
LinInDenver earned 2000 total points
ID: 29122807
Hi Brad!

Yes I have sub reports with many pages.
Most of my reports are designed to drop sub reports into the detail section, mainly because my Main Report doesn't actually do anything but hold sub reports (i.e.: Main report contains parameters to link into the sub reports, but no actual SELECT statement is stored inside it).

If I can't put them in detail, I usually stick mine in a Group Footer. Sometimes this is just a "fake" Overall group - one that groups all my detail into one group. This would be a group on a formula for something like  IF ISNULL(field) then 'Overall' else 'Overall'. You can place sub reports in a "fake" group header or footer like this, and then drop N of M into Page Footer.

I hope this helps.
0
 

Author Comment

by:Brad_Shillito
ID: 29123838
LininDenver:

I saw online a solution using group header as you suggested.
What was not clear to me is do you use a separate groupheader for each report or insert all into the same group header?
I need a separate group header so I can change from portfolio to landscape orientation for some of the reports.
0
 
LVL 14

Expert Comment

by:LinInDenver
ID: 29124836
Hi Brad!

Put them in different group header sections (right click on GH1 and insert section - as many as you need for each sub report)  - it allows you to do what you describe (change portrait/landscape) and also prevents your sub reports from printing on top of each other.

Let me know if that makes sense.
0
 

Author Closing Comment

by:Brad_Shillito
ID: 31709149
I tested your suggestion using multiple group headers and was succesful.  I still would like to know if there is a way to get my shared variables to work, but for now I can get done what is required.
0
 
LVL 101

Expert Comment

by:mlmcc
ID: 29126557
Until You generate the complete report you don't know the number of pages the report takes.  by clicking the >> in the paging, you force the report to generate the complete report and thus you have the number of pages.

mlmcc
0

Featured Post

Get expert help—faster!

Need expert help—fast? Use the Help Bell for personalized assistance getting answers to your important questions.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Today, still in the boom of Apple, PC's and products, nearly 50% of the computer users use Windows as graphical operating systems. If you are among those users who love windows, but are grappling to keep the system's hard drive optimized, then you s…
The Relationships Diagram is a good way to get an overall view of what a database is keeping track of. It is also where relationships are defined. A relationship specifies how two tables connect to each other. As you build tables in Microsoft Ac…
This video tutorial shows you the steps to go through to set up what I believe to be the best email app on the android platform to read Exchange mail.  Get the app on your phone: The first step is to make sure you have the Samsung Email app on your …

599 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question