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

How to show X number of records per page

Status
Not open for further replies.

CrystalSS

Technical User
Nov 15, 2002
8
0
0
US
I have a report that is grouped twice.
First it is grouped by Record name, second it is grouped by Value X.

I have decided that I only one to show 6 records on a page.

I know that I can use variables and state that
X := X + 1 for each record, and then conditionally insert a new page after when Remainder(X,6) = 0.

However, I am trying to do this without a variable like this.

I have tried the recordnumber and groupnumber functions, but since I have two groups these numbers do not reflect the record name, but the number of the values this person has. For example Record 1 has the recordnumber and group number values of 1. However, since record 1 has 11 values (group 2), the second record is actually given recordnumber and groupnumber 12.

This number will never be in sequence.

Is there another way to do this? Is there possibly a way to get groupnumber to only count group # 1? Is there any way to reset the groupnumber value?

Thanks as always.
 
Dear Crystal SS,

Insert a runningtotal that counts the field and sent the section to new page after with a formula

RTotalName = 6

Hope that helps,

ro

Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
If you want a new page after 6 detail records within each group, then you would create a running total {#cntwingrp} as Rosemary suggested, setting it to reset on change of group (your inner group?), and then go to the section expert->new page after and enter:

{remainder({#cntwingrp}, 6) = 0

But if what you are saying is that you want a new page after every six lines of data, including group sections, then create a variable {@lincnt}:

whileprintingrecords;
numbervar linecnt := linecnt + 1;

Place this in every displayed section. Then go to the section expert->new page after and enter:

remainder({@linecnt},6) = 0

-LB
 
Hey LBASS,

Why do you use the remainder function?

Regards,

ro

Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Ro,

So that there is a new page after every six records, not just the first six records. Am I missing something?

-LB
 
Dear Lbass,

Nope ... I was .. let's blame it on my medication :)

Regards,

ro

Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
Ro,

The reason I asked if I was missing something is because I am a little groggy from medication, too!

-LB
 
Dear Lbass,

I hope you feel better ... soon

ro

Rosemary Lieberman
rosemary@microflo.com, Microflo provides expert consulting on MagicTSD and Crystal Reports.
 
I am trying this and it seems to work fine except.
I have a report that is a form, I copied and pasted the form as a picture on the report and I intend to lay the data over top of the picture. I need to place 8 employees on each page with there hours. When I use the above mentioned way it works fine untill I un supress my form that is in the page footer and it makes the report print a page for every employee, not every 8 employees. I am guessing the reason is the form takes up the whole page and there is barely enough room for the one employee at the top of the page. I was going to try grouping on blocks of 8 but could not figure that out.
Any help would be apreciated.
 
Try putting the form in the page header. Then go to the section expert (format->section)->page header->check "Underlay following sections".

-LB
 
One thing I would add to lbass's formula for the new page after is a condition to keep from forcing a new page on the last page if the remainder is 0.

remainder({@linecnt},6) = 0 AND not(onlastrecord)

This will keep from forcing an extra page at the end.

~Brian
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top