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

Best approach to sum values from detail tables

1 Answer 264 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
Simon
Top achievements
Rank 1
Simon asked on 01 Nov 2011, 06:37 AM
Hi,

Image of screen attached.
I have built a cross tab that has a number of row groups.
I have three columns which perform a sum aggregate.
Local Column - marked as 1 on screenshot  (which is a field from the EntityDataSource that the grid is bound to) works fine and simply sums the field values for each group
Columns 2 and 3 are bound to sub reports. The sub reports simply sums all items grouped by id. In isolation this works fine.My plan was that the master report would pass in the Id(s) to the sub report as parameters and the sum would happen. However this is not the case.

Problem
When I put the sub reports into the cells as shown beneath 2 and 3 - no values are returned. The sub reports are passed in the parameter that is meant to represent the current row Id - but it does not appear that these are passed in for every master report item.
So the totals are not calculated.
I also need to sum column 1, 2 and 3. 

Please advise if this can be done and how best to do it. An example would be great. C#.

Thanks
Simon

1 Answer, 1 is accepted

Sort by
0
Simon
Top achievements
Rank 1
answered on 03 Nov 2011, 05:22 AM
I've resolved this by doing the sum calculation in the partial class for the Business Entity at the EF level.
It's fast too. Still interested to know if there's another way to do it.
Thanks
Tags
General Discussions
Asked by
Simon
Top achievements
Rank 1
Answers by
Simon
Top achievements
Rank 1
Share this question
or