2005 IR Help Posted August 24, 2006 Share Posted August 24, 2006 By: John Wells - jbwiv Page number display in sub reports? 2004-03-15 20:30 Hello. I have a report that calls two subreports. I need to acurately display the overall page number in these subreports, based on the total number of pages passed, so reflecting the PAGE_NUMBER variable from the master report, and not the PAGE_NUMBER relative to the subreports. Any idea how to do this? Thanks, jbwiv By: sathya - postsathya RE: Page number display in sub reports? 2004-03-15 20:33 U ve a solution in the samples provided , go thru it and u might get an idea By: David Lim - aberrant80 RE: Page number display in sub reports? 2004-03-15 21:53 I don't think that's possible. You can't pass a parameter to a subreport once it's been started up. You can only do it as an initialisation. The way I figure, you might want to try using the subreport itself to do the page numbering. By: John Wells - jbwiv RE: Page number display in sub reports? 2004-03-16 10:14 The problem is that the master reports cycles through a sequence of records and calls the two sub reports for each record. If I use $V{PAGE_NUMBER} in the subreport, it'll only display the number of pages passed for the current subreport, but since the master calls the sub reports numerous times, this doesn't work correctly. Rather than having Page 1 of 32, where 32 is the total number of pages in the master report, I'll have Page 1 of 2, where 2 is the maximum number of pages in the subreport, and then a few moments later I might have page 1 of 8, because in this subreport iteration there is 8 total pages. So, rather than track on subreport level, I need to track on a global level. Any idea how to do this? Thanks! jbwiv By: David Lim - aberrant80 RE: Page number display in sub reports? 2004-03-16 18:08 The only other thing that comes to mind is scriptlets. You could have your main report and subreports share a custom scriptlet that you could use to update your page number, probably calling the scriptlet each time you reach the page footer band. By: John Wells - jbwiv RE: Page number display in sub reports? 2004-03-15 20:36 I've looked at the sample, but it maintains page number at the bottom of the master report. I actually need to print page number in the format of the two subreports because of a complicated layout. The master actually has nothing to display at all...it's merely a wrapper report that immediately calls the two subreports in the detail band. By: Teodor Danciu - teodord RE: Page number display in sub reports? 2004-03-17 00:57 Hi, I think it is possible. As David suggested, you pass the PAGE_NUMBER value of the master report to the subreport when it starts and then you add this initial value to the PAGE_NUMBER of the subreport. Both master and subreport have their own PAGE_NUMBER variable, you just need to add them. If your subreport starts at page 9 and goes to 16, then when starting the subreport you pass the PAGE_NUMBER from the master (9) and the PAGE_NUMBER inside the subreport will increment itself from 1 to 8. Adding the parameter to the subreport PAGE_NUMBER and subtracting 1 will give you something that increments from 9 to 16, just like you want to. I hope this helps. Teodor Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now