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

Running Total 1

Status
Not open for further replies.

priest2

Technical User
Aug 6, 2003
1
GB
I have a report with a field which contains a quantity.
Further down the report, I want to create a table which will rows saying 1 of ?, 2 of ?, etc., depending on what the quantity is. So if the quantity is 10, it will say 1 of 10, 2 of 10, etc. But what is also needed, is that if the quantity is greater than 5, the next group ie 6 of 10, will be printed on another page with exactly the same layout. This also applies if it is greater than 10.

Cheers,

Rob
 
I'm not sure I understand what you're trying to do. In Crystal 8.5, you could use [Format Section] and a formula for [New Page After], which would test for a value of 5.

Madawc Williams
East Anglia, Great Britain
 
You will have to use variables to establish a count of each record. You will also need group on the item to detail, suppress details and show group footer as your detail line.

Create formula which is placed in your group header which declares a variable and then counts records called say "recordcount", in your footer you will need to display the result of that count and it will look something like

Whileprintingrecords;
global numbervar recordcount;

totext(recordcount,0,"")+" of "+totext(count({fieldname},0,"");

when you totext a number the default is 2.00, the arguments in the totext formula remove the decimal places and the point.


In your format enter a formula for your newpage after (group footer) which is

whleprintingrecords;
global numbervar recordcount;

remainder(recordcount/5 <>0)

This should suppress new page after until that condition is met.

Ian Waterman
UK Crystal Consultant
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top