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

11 posts, 0 answers
  1. David Kozikowski
    David Kozikowski avatar
    3 posts
    Member since:
    Sep 2009

    Posted 19 Aug 2010 Link to this post

    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

  2. Peter
    Admin
    Peter avatar
    1652 posts

    Posted 20 Aug 2010 Link to this post

    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
  3. Mark
    Mark avatar
    155 posts
    Member since:
    Oct 2010

    Posted 14 Jun 2011 Link to this post

    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.
  4. Peter
    Admin
    Peter avatar
    1652 posts

    Posted 17 Jun 2011 Link to this post

    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
  5. Mayank Tyagi
    Mayank Tyagi avatar
    4 posts
    Member since:
    May 2007

    Posted 20 Sep 2011 Link to this post

    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).
  6. Jolanta
    Jolanta avatar
    1 posts
    Member since:
    Feb 2015

    Posted 08 Feb 2015 Link to this post

    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




  7. Nasko
    Admin
    Nasko avatar
    1051 posts

    Posted 11 Feb 2015 Link to this post

    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.

     
  8. Jolanta
    Jolanta avatar
    34 posts
    Member since:
    Oct 2014

    Posted 12 Feb 2015 in reply to Nasko Link to this post

    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
  9. Nasko
    Admin
    Nasko avatar
    1051 posts

    Posted 16 Feb 2015 Link to this post

    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.

     
  10. Jolanta
    Jolanta avatar
    34 posts
    Member since:
    Oct 2014

    Posted 16 Feb 2015 in reply to Nasko Link to this post

    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
  11. Nasko
    Admin
    Nasko avatar
    1051 posts

    Posted 17 Feb 2015 Link to this post

    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.

     
Back to Top