C# .NET - Crystal Report: Sum of a field Page Wise

Asked By Yogesh Mishra on 25-Jun-12 10:02 AM
Earn up to 20 extra points for answering this tough question.
I have a crystal report having fields ID, Name, Address, Salary.
I Want total of salary per page on the report footer.
How can i do that?
DL M replied to Yogesh Mishra on 25-Jun-12 11:54 PM
Check this article
----------------
http://www.codegain.com/articles/crystalreports/general/how-to-use-running-total-fields-in-crystal-report.aspx
Jitendra Faye replied to Yogesh Mishra on 26-Jun-12 12:32 AM
Add this formula in report footer

=Sum(ReportItems("ColumnName").Value)

Try this and let me know.
TSN ... replied to Yogesh Mishra on 26-Jun-12 12:43 AM
hi.... try the below one...

Create a formula field TOTAL1 and edit this code: 

 

WhilePrintingRecords;
NumberVar SALARYTOTAL;
SALARYTOTAL := 0; 

 
Place TOTAL1 in page header section.

Create a formula field TOTAL2 and edit this code: 

 

WhilePrintingRecords;
NumberVar SALARYTOTAL;
SALARYTOTAL:= SALARYTOTAL + {field01}; //IN YOUR CASE IT IS field01 is SALARY

where field01 is the field to summarize. 

 
Place TOTAL2 in details section.

Create a formula field TOTAL3 and edit this code:
 

 

WhilePrintingRecords;
NumberVar SALARYTOTAL;

Place TOTAL3 in page footer.
 
TSN ... replied to Yogesh Mishra on 26-Jun-12 12:44 AM
Create a formula field TOTAL1 and edit this code:

WhilePrintingRecords;
NumberVar SALARYTOTAL;
SALARYTOTAL := 0;

Place TOTAL1 in page header section.

Create a formula field TOTAL2 and edit this code:

WhilePrintingRecords;
NumberVar SALARYTOTAL;
SALARYTOTAL:= SALARYTOTAL + {field01}; //IN YOUR CASE IT IS field01 is SALARY

where field01 is the field to summarize.

Place TOTAL2 in details section.

Create a formula field TOTAL3 and edit this code:

WhilePrintingRecords;
NumberVar SALARYTOTAL;

Place TOTAL3 in page footer.
 
Yogesh Mishra replied to DL M on 26-Jun-12 02:29 AM
Hi DLM,
This link does not provide me thing what I actually want.
Actually When I am at first page it works quite good but at second page it preserve the total of first page and add the sum of second page total to it.
I want total of salaries per page separately.
RAJASEKHAR RAJENDRAN replied to Yogesh Mishra on 27-Jun-12 08:26 AM
Hi Yogesh,

You can get the Page Total in the Crystal Report in the footer as in the below link.
http://www.effegidev.com/post/Page-Total-in-Crystal-Report.aspx 



Thanks & Regards,
Rajasekhar.R