Click here to Skip to main content
15,892,809 members
Please Sign up or sign in to vote.
3.00/5 (1 vote)
See more:
Hi,

I'm new to crystal reports.

I have a crystal report having a running total field.
The field data type is int32 in the dataset and have the integer values in the data set.
I have added the running total value of the field as sum, but it only displays the number of records in the report (count of records).


How can I get the sum instead of count?

Thanks.
Posted
Updated 9-Mar-11 21:58pm
v2
Comments
Dalek Dave 10-Mar-11 3:58am    
Edited for Readability.

Have a look at this very good article: Step by Step Creation of Crystal Report using its Features Group, Graph, Cross-Tab and Sub Report[^]

Either, it would be a running summary or a grouped one. Look which one fits in for you and implement it.

For grouping, it's already there in article. For running summary:
1. right click on report click Insert->Summary
2. select the field you want to sum

If it's too complex, use formula fields.
 
Share this answer
 
Comments
shaijuvjohn 10-Mar-11 4:13am    
Thanks for your reply.
I have inserted summary of the field but it not displays the sum. It displays the count as already shown.
hi
because in place of your code, you have a type casting from (decimal,int) to string
you must find that an solve it

Something like this (in this sample default datatype is string)


C#
dt = new DataTable("TBL");
dt.Columns.Add("comment");
dt.Columns.Add("num1");
dt.Columns[1].DataType = typeof(Int32);
dt.Columns.Add("num2");
dt.Columns[2].DataType = typeof(float);
 
Share this answer
 
Comments
Despermate Chikanga 9-Feb-23 2:50am    
Solved ny problem. Thank you

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900