Print Page | Close Window

How to do total reset per page?

Printed From: Crystal Reports Book
Category: Crystal Reports 9 through 2020
Forum Name: Technical Questions
Forum Discription: Formulas, charting data, Crystal syntax, etc.
URL: http://www.crystalreportsbook.com/forum/forum_posts.asp?TID=14927
Printed Date: 04 May 2024 at 5:45am


Topic: How to do total reset per page?
Posted By: swanaint
Subject: How to do total reset per page?
Date Posted: 11 Nov 2011 at 12:19am
I have create report invoice which have to display total per page, I use the running total file it can reset total amount per group but can't reset amount per page.



Replies:
Posted By: FrnhtGLI
Date Posted: 11 Nov 2011 at 2:04am
I'm not sure if there is an easier way, but the three-formula manual running total would be a good solution.

1st Formula (Initialize Formula):

whileprintingrecords;
global numbervar nTotal:=0;

2nd Formula (Calculate Formula):

whileprintingrecords;
global numbervar nTotal:=nTotal + {table.field};

3rd Formula (Display Formula):

whileprintingrecords;
global numbervar nTotal;

Place the first formula, suppressed, in a Page Header section.
Place the second formula, suppressed, in the detail section where the value you wish to calculate is displayed.
Place the third formula at the bottom of the page where you want to total per page displayed.


-------------
|< /\ '][' ( )


Posted By: swanaint
Date Posted: 14 Nov 2011 at 7:39pm
Thank you. it's work.


Posted By: khunnathawat
Date Posted: 28 Dec 2011 at 10:38pm
your solution is work if you place third formula at the bottom of page, but if I want to display third formula at PageHeader so it display zero number.
please help.


Posted By: khunnathawat
Date Posted: 28 Dec 2011 at 10:39pm
Originally posted by FrnhtGLI

I'm not sure if there is an easier way, but the three-formula manual running total would be a good solution.1st Formula (Initialize Formula):whileprintingrecords;global numbervar nTotal:=0;2nd Formula (Calculate Formula):whileprintingrecords;global numbervar nTotal:=nTotal + {table.field};3rd Formula (Display Formula):whileprintingrecords;global numbervar nTotal;Place the first formula, suppressed, in a Page Header section.Place the second formula, suppressed, in the detail section where the value you wish to calculate is displayed.Place the third formula at the bottom of the page where you want to total per page displayed.




your solution is work if you place third formula at the bottom of page, but if I want to display third formula at PageHeader so it display zero number. please help.


Posted By: lockwelle
Date Posted: 29 Dec 2011 at 3:32am
you can't place the 3rd formula in the page header...
it will always display zero because you have not 'read' / calculated the 3rd formula, because the 2nd formula has not been accessed...not in the page header.
 
If you want to display the total from the prior page, then display the 3rd formula in pageHeader1, and create a second page header section BELOW the one that displays and place the first formula there.
 
HTH


Posted By: khunnathawat
Date Posted: 03 Jan 2012 at 4:31pm
ok, am try to do follow your reccomend, it display total number of prior page in next page. but i want to display once first page is display.
thank you so much for your reccommend.



Print Page | Close Window