How to print a subtotal base on per page, lets say i have 3 pages in crystal report there should be a subtotal per page. How to do that ?
Printable View
How to print a subtotal base on per page, lets say i have 3 pages in crystal report there should be a subtotal per page. How to do that ?
Moved To Reporting
You need to use three formulas
Formula 1 : @Reset
Formula 2 : @SumCode:NumberVar x;
WhilePrintingRecords;
x:=0;
Formula 3 : @DisplayCode:NumberVar x;
WhilePrintingRecords;
x:=x+{DatabaseField};
Place Formula1 in Page Header section and suppressCode:NumberVar x;
WhilePrintingRecords;
x
Place Formula2 in Details section and suppress
Place Formula3 in Page Footer and don't suppress, this is your subtotal
JG
Shouldn't that NumberVar be declared as Shared? Or is that the default in more current versions of Crystal? I thought local was the default so I have always explicitly declared when I need it shared.
Default is 'Global'
A 'Shared' variable should be used when you need to pass (share) a value from the main report to a subreport or from a subreport to the main report
In this case I think that a 'Global' or a 'Local' variable will do the job because is in the same main report
JG
Wow, learn something every day. Been working with Crystal over a decade and I guess I have never used the same variable name twice for different purposes. I'll watch that in the future. Thanks