Link to home
Start Free TrialLog in
Avatar of donalric
donalric

asked on

Generating and Printing a page total in Crystal Reports 8.5

I am designing a report that requires that, for each page, the sum of a specified column is to be displayed at the end of the column before going on to the next page. For each page the total displayed should be sum of the column values on that page.

There is also a requirement that the same total at the end of the page be displayed at the top of the next page.

How do I achieve this?

example:

------Page 1------------
previous page total: 0
chq_amt
100.25
50.25
58.50
20.75
20.25
current page total: 250

----Page2--------
previous page total: 250
chq_amt
10.50
18.25
100.75
20.50
50.00
current page total: 200
etc.




ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of donalric
donalric

ASKER

I created the formula and placed the stuff on the page but The figures are out.

This is what I have:
//{@VarDecls} in report header
whileprintingrecords;
global numbervar CurrentPageTotal := 0;
global numbervar PrevPageTotal := 0;
// This formula is placed in the report header


//{@resetCurrentPageTotal} This is placed in the page header
whileprintingrecords;
global numbervar CurrentPageTotal := 0;
global numbervar PrevPageTotal;


//{@Total} This  is placed in the detail section
whileprintingrecords;
global numbervar CurrentPageTotal := CurrentPageTotal + {pap_impt.lodge_amt};


//{@SetPrevPageTotal} This is placed in the page footer
whileprintingrecords;
global  numbervar PrevPageTotal := global numbervar CurrentPageTotal;
global numbervar CurrentPageTotal



You said that I should put {@PrevPageTotal} in the page footer but I put {@SetPrevPageTotal} instead as I didn't create a {@PrevPageTotal} function.  could this be the problem
No that was a typo on my part.  Good catch.

What totals are you getting?

mlmcc
How could I email you the report.  probable that would be the best thing.
Sorry, it was my bad.  I placed {@Total} in the wrong section.  I placed it in a group rather than in the detail section.
Can you have Null values in your {pap_impt.lodge_amt}?

Cheers,
- Ido
Glad I could help

mlmcc