PDA

Click to See Complete Forum and Search --> : RESET running total after each page


jepperly
Sep 3rd, 2008, 10:39 AM
Hi, i have a report in which i only need to display 20 records
per page, how would i make my running totals to resets every page,
ive tried using RESET---> Formula, but i just cant nail it there...
any suggestion? please, and BTW how would you limit the records to a certain
number? what i did is in the SECTION EXPERT---> after new page,
ive inserted a formula something like this, [recordnumber mod 20 = 0]
this works fine, but do you have any suggestion? thanks in advance

brucevde
Sep 3rd, 2008, 12:14 PM
Which version of Crystal Reports (I am assuming you are using Crystal)?

Using PageNumber Mod 20 = 0 is the best way to limit records/page that I have seen.

To create "Page Totals" you need to use a global variable with 3 formulas. 1 formula to reset the global variable, 1 formula to add the value from the current record to the global variable and 1 formula to display the global variable.

1) ResetPageTotal - put this formula in the Page Header section suppress/hide the object.
WhilePrintingRecords;
Global currencyVar PageTotal := 0;

2) CalcPageTotal - put this formula in the Details section suppress/hide the object.
WhilePrintingRecords;
Global currencyVar PageTotal;
PageTotal := PageTotal + {Order_Details.Amount};

3) DisplayPageTotal - put this formula in the Page Footer section
WhilePrintingRecords;
Global currencyVar PageTotal;
PageTotal;

jepperly
Sep 3rd, 2008, 10:30 PM
Thank you, it works...