This is a migrated thread and some comments may be shown as answers.

Incorrect value in Sum Footer

1 Answer 137 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Victor
Top achievements
Rank 1
Victor asked on 06 Feb 2019, 11:28 PM

Hi, I have a simple report where I make a Sum in the footer that summarizes depending of the invoice date. I have only one record with a value of 120.01 but the Sum of that record displays 120.00 in the footer. The format I am using is Numeric with 2 decimals and the field coming from the DB is a decimal, the other formulas are correct. Any idea ?

The attached file shows the generated report.

Thanks a lot !

1 Answer, 1 is accepted

Sort by
0
Neli
Telerik team
answered on 08 Feb 2019, 04:39 PM
Hello Victor,

When you use the Sum Aggregate function, it acquires the Type of the first number added to the total. For example, if the first number is 0 (which will be accepted as an Integer), all next addends will be converted to Integer. That's why the field with the total Sum will be calculated and represented as an Integer.
Note that the Sum will be calculated first (i.e. as Integer) and then the TextBox where the result is displayed will be formatted with the provided Format, hence the value will look as if *not* correctly calculated.

The right Expression in your case should be as follows :

=Sum(IIF(Fields.Vense="SV",Fields.Saldo,0.0))

The explicit 0.0 assures that the hard-coded value will be taken as a float/double.

Regards,
Neli
Progress Telerik
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
General Discussions
Asked by
Victor
Top achievements
Rank 1
Answers by
Neli
Telerik team
Share this question
or