I am generating the crystal report in the ASP.NET/C# Website. I require the groupwise sum in the header of the group, When I add the SUM field (Running Total Field) shows the first entry of the records is there any way to show the total of all records in details in the header of the same group?
2 Answers
Running Totals won't work in a Group Header section because of the way they are evaluated. Instead, you could just use a regular summary function and place it in the Group Header. You can do this by either right-clicking the field to summarize, selecting "Insert", and then "Summary" or by creating a formula:
sum({table.field_to_summarize},{table.field_you_are_grouping_on})
using Subreports and link them and show Sum of that group in subreport.
put your subreport in Group header of main report
Design a Query from DB and Get Sum of Group in desird feilds.
for example :
Select GId,Sum(Salary) as SSalary from Customer group by GID
and create a subreport in your Main Report by Right Click and select Insert and SubReport -> select Previous Step DataSet -> Next you must link Them with Group Ids and in fill report you must fill subreport[0] of your main report by adequate data from his dataset for detail info refer to Subreports