Philip
Philip

Reputation: 269

How Can I sum up the column with decimal value in C# crystal report

Why is it not summing up. The datatype of totalamount due is decimal and When I insert a summary there is no sum in calculate summary.

enter image description here

Upvotes: 1

Views: 871

Answers (3)

Ajay Kumar
Ajay Kumar

Reputation: 1

Yes crytsal report returns each data as string.

NumberVar value1 := yourValue;   
NumberVar value2 := yourValue;

NumberVar is crystal reports defined DataTypes. (here are some data types and conversions) http://ntssp.blogspot.com/2011/02/converting-data-types-in-crystal-report_16.html
This will treat your string data as numbers. and try doing your stuff.

Upvotes: 0

Dan
Dan

Reputation: 56

I'm not familiar with C#, so I'm not sure about the decimal data type, but Crystal reports is treating your field totalamountdue as a string. To get around this I'd create a simple formula then sum that instead:

if isnumeric({basetransactions1.totalamountdue})
then tonumber({basetransactions1.totalamountdue})
else 0

Upvotes: 0

Philip
Philip

Reputation: 269

I did it when i created a formula and convert it to Number and then Create another formula where it will hold the sum

Upvotes: 1

Related Questions