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

Sum function not working properly.

4 Answers 733 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Muhammad
Top achievements
Rank 1
Muhammad asked on 05 Jan 2018, 06:46 AM
Hi there

I'm working on a report in which I have to take Sum of a field, I'm using this expression right now. =Sum(Fields.ReceivedAmount).
This expression works fine in Standalone reporting tool but when I apply the same thing over Reporting in Visual Studio all I get is the result shown in the attached picture. 
Can somebody help me out please if there is something out of the box needs to be done in here ?

Thank you

4 Answers, 1 is accepted

Sort by
0
Silviya
Telerik team
answered on 05 Jan 2018, 02:14 PM
Hi Muhammad,

Telerik Reporting is using the same engine in order to create full-featured report definitions. So, it have to be some differences between the report definitions used in Standalone Report Designer and Visual Studio Report Designer that produces different output when the report is rendered.

Based on the provided screen shot, I assume that the data field type in this report definition is set to String, because it looks like they are concatenated with the SUM() aggregate function.
In order to avoid it, I can suggest to use conversion function CDbl(expression) to convert the field values to Double. But if it possible to change configuration of the DataSource, you can change the type of the column there.

Regards,
Silviya
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
0
Muhammad
Top achievements
Rank 1
answered on 06 Jan 2018, 09:34 AM
Hello Silviya, 

Thank you for your prompt response. I tried your proposed solutions and I also double checked the data types in the database as well. Now what I did to achieve the calculated amount is to use the SUM function in the query and now I am getting my solution but there is also a point where I have to calculate the entire row and it can;t be done in query because I can't use Sum inside another SUM or something like that. It would've been better if this worked. 
Anyways Thank you if you have any other solution please do help me out it will really help me 

Thanks
0
Accepted
Silviya
Telerik team
answered on 10 Jan 2018, 01:24 PM
Hi Muhammad,

You are right, by default, Telerik Reporting does not supports nested aggregate functions.

If I understand right you have to calculate the row sum values. If so, I can suggest you to use Crosstab data item in order to display aggregated data summaries, grouped in rows and columns. 

An example Crosstab and its properties can be found at the bottom of the Understanding Crosstab Areas help article.

Regards,
Silviya
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
0
Muhammad
Top achievements
Rank 1
answered on 09 Feb 2018, 06:48 AM
Thank you for your response Silviya. I got what I needed.

Best, 
Tags
General Discussions
Asked by
Muhammad
Top achievements
Rank 1
Answers by
Silviya
Telerik team
Muhammad
Top achievements
Rank 1
Share this question
or