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

Page numbering - reset for each subreport

Status
Not open for further replies.

scobey

Programmer
Jun 22, 2000
7
0
0
FR
I need to create section numbering in a report, e.g the title page will be section 1 page 1; page 2 would be section 2 page 1 and so on.  Is there a way of doing this using a formula or any other method.  
 
One question before I give my code sample:<br><br>Do you always know the page that the new sections will begin on or must you look at something else in the report to determine this?<br><br>If you always know there will be 12 pages in section 1 and 20 pages in section 2 and so forth then the code for the formula will look like this:<br><br>if PageNumber in [1 to 12] then &quot;Section 1 Page &quot; + ToText(PageNumber)<br>else<br>if PageNumber in [13 to 33] then &quot;Section 2 Page &quot; + ToText(PageNumber)<br><br>We must convert the PageNumber to text so the string concatenation will work.<br><br>To make sure the PageNumber doesn't show up with decimal places, (1.00) go to File¦Options¦Fields and change the format of the number fields to show no decimals.<br><br>Now, just stick this formula in your page header.<br><br>If you must watch for other criteria to determine when the sections start then the code will have to reflect this, of course.<br><br>Hope this helps. <p>Cody ford<br><a href=mailto:codyford@yahoo.com>codyford@yahoo.com</a><br><a href= > </a><br>VB, VBS, Seagate Info/Crystal Reports<br>
 
Thanks Cody.&nbsp;&nbsp;Unfortunately I won't know how many pages are in each section prior to refreshing the report data.&nbsp;&nbsp;I appreciate your help, though.&nbsp;&nbsp;This tip will probably come in useful in the future, so I have it on file.
 
Do you know what you have to watch to determine when you go to another section? Do you watch for a keyword, database field or something else? If you know what changes from section to section I may be able to help you get the rest of the way.<br><br> <p>Cody ford<br><a href=mailto:codyford@yahoo.com>codyford@yahoo.com</a><br><a href= > </a><br>VB, VBS, Seagate Info/Crystal Reports<br>
 
It would be great if you could.&nbsp;&nbsp;The way the report is layed out is as follows.&nbsp;&nbsp;The table of contents is going to be section 0.&nbsp;&nbsp;This may contain 1 or 2 pages, depending on what view of the database I am reporting on.&nbsp;&nbsp;Each page here will be numbered 0.1 and 0.2.&nbsp;&nbsp;&nbsp;The main reports will be inserted as subreports in the report footer.&nbsp;&nbsp;They will be numbered 1.1, 1.2 and so on.&nbsp;&nbsp;So the sections break at each subreport.&nbsp;&nbsp;Does this give you any more ideas about how to fix the problem.&nbsp;&nbsp;I really appreciate your help on this, it has been sticking me for a few days now, and the boss is getting impatient.&nbsp;&nbsp;Not to worry, she can cool her heels for a while longer.&nbsp;&nbsp;It doesn't do to always let them have their way.
 
Yes, this helps some.<br><br>Since the subreports separate the sections this makes the code unique for each.<br><br>The subreport for section one will have a formula like this:<br>&quot;Section 1 Page &quot; + ToText(PageNumber)<br><br>The subreport for section two will have a formula like this:<br>&quot;Section 2 Page &quot; + ToText(PageNumber)<br><br>Placed in the report footer or wherever you need them...<br><br>Now, the main report, (The parent of the subreports) can have its own page number.<br><br>You may have to hide the main page number conditionally for the subreport page numbers to take over - I'm not sure. I'm building this in my head before the caffeine kicks in so forgive me for that.<br><br>Hope this gets you closer.<br> <p>Cody ford<br><a href=mailto:codyford@yahoo.com>codyford@yahoo.com</a><br><a href= > </a><br>VB, VBS, Seagate Info/Crystal Reports<br>
 
I have two sub reports placed on main report.
Total number of pages are 8.
First 4 pages is from 1st subreport and
Second 4 pages from 2nd subreport.

pagenumber should be displayed as
1 for 1st page of 1st subreport.
2 for 1st page of 2nd subreport.
3 for 2nd page of 1st subreport.
4 for 2nd page of 2nd subreport.
5 for 3rd page of 1st subreport.
6 for 3rd page of 2nd subreport.
7 for 4th page of 1st subreport.
8 for 4th page of 2nd subreport.
how to do the page numbers??? pls.answer me??
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top