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

How to get the SUM() of group footer section into the Report footer section

10 Answers 2545 Views
General Discussions
This is a migrated thread and some comments may be shown as answers.
David Kozikowski
Top achievements
Rank 1
David Kozikowski asked on 19 Aug 2010, 05:25 PM

OK I have looked in the docs to no avail.

Take a look at the attached files. What I want to do is get the value that is in the first section Total

(This is a group footer section in Telerik) in the example the value is 81 and I want to show this value in the report footer section. I want to do the same thing for the next group. Things work great when used under the group, and for the entire report SUM() works but how would I display a group value  that is the result of a SUM() on the group in the report footer?

 

I’m sure this can’t be hard but can’t seem to find the info on what to put into the text box value.

 

I was thinking it might be something like value =  MyReport. sectionNamesGroupFooter(0). Sum(Fields.Count) or something with the 0 representing the first group if I wanted the value of the second group I would use value =  MyReport. sectionNamesGroupFooter(1). Sum(Fields.Count)

 

Thanks

10 Answers, 1 is accepted

Sort by
0
Peter
Telerik team
answered on 20 Aug 2010, 01:30 PM
Hi David Kozikowski,

Currently we don't have a group indexer. However you can still access the Group Footer sum with Events. I have attached a sample report that shows how to accomplish your requirement. To run the sample project you will need the AdventureWorks database that comes with Telerik Reporting installation.

Kind regards,
Peter
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Mark
Top achievements
Rank 1
answered on 14 Jun 2011, 10:22 PM
Can you please confirm that this is still the necessary approach to aggregating group sums.  I wsa hoping something a bit more friendly might have been added.
0
Peter
Telerik team
answered on 17 Jun 2011, 02:30 PM
Hello Mark,

You still have to use the suggested workaround for accessing inner group aggregates.

Greetings,
Peter
the Telerik team
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 Public Issue Tracking system and vote to affect the priority of the items
0
Mayank Tyagi
Top achievements
Rank 1
answered on 20 Sep 2011, 03:01 PM
You can do this using a conditional expression in the report footer.

EG: 

=Sum(IIf(Fields.Product_Type="IRS", Fields.NPV, 0 ))

The above condition will generate a sum of all NPV values where the product type is 'IRS'.  The one downside to this is you need to know the "Groupby' (Fields.Product_Type="IRS", ) value for the iif statement. I use this method where the group by values do not change.

The other option is to insert a sub report with only a group by section into the main report page footer and set it data source to the same as the main report. (I set the data source in the code behind).
0
Jolanta
Top achievements
Rank 1
answered on 08 Feb 2015, 02:56 PM
Hi, I am a beginner with Telerik reports, I use a Telerik Report Designer for producing custom reports.

My question is: I have 2 tables, each one has its own data source. Each table has a group sum at the buttom.
I need to sum values of the first and the second table.

Table1
a    aa    aaa
1    11   111
4    44   444
----------------
5    55  555

Table2
b   bb   ccc
2   22   222
7   77   777
---------------
9   99   999

I need sum of the group sum rows (5... and 9...)
----------------
14 154 1554

I have no idea, how to do it...
Please, help,
Jola




0
Nasko
Telerik team
answered on 11 Feb 2015, 02:09 PM
Hello Jola,

The two table items are separate Data Items with their own data sources. In order to calculate the total, you need to create a data source which contains all of the detail rows and then use this data source with a new data item to display the total.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jolanta
Top achievements
Rank 1
Veteran
answered on 12 Feb 2015, 07:52 AM
Thank you for the answer. I was afraid of the only answer...
The problem is: I often use already prepared DataSources, and have no access to their creation. I would like to combine several DataSources at my reports, especially as conditions fields, sums aso...
Jola
0
Nasko
Telerik team
answered on 16 Feb 2015, 02:56 PM
Hello Jola,

A possible approach is to join the data programmatically in your application and send it to the report wrapped in an ObjectDataSource Component.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
0
Jolanta
Top achievements
Rank 1
Veteran
answered on 16 Feb 2015, 04:18 PM
Thank you for the answer.
Ok, this solution I have understood from the previous posts and documentation.
But we wanted somebody to be able to use already existant DataSource - just in Telerik Report Designer, beyond the application and then to upload the reports to the application, by himself. So, anyone, not connected to the programmer team could produce the reports independently.
And for such constellation it would be nice to have possibility, that several DataSourcea see each other aso.
Greetings,
Jola
0
Nasko
Telerik team
answered on 17 Feb 2015, 03:17 PM
Hello Jola,

Multiple data objects or SQL tables will have to be joined together when you would like to aggregate the data from all of the sources. This join operation could be done by your programmer team and they could provide the combined data source to the users.

Regards,
Nasko
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
General Discussions
Asked by
David Kozikowski
Top achievements
Rank 1
Answers by
Peter
Telerik team
Mark
Top achievements
Rank 1
Mayank Tyagi
Top achievements
Rank 1
Jolanta
Top achievements
Rank 1
Nasko
Telerik team
Jolanta
Top achievements
Rank 1
Veteran
Share this question
or