Complex Calculations in Group Footer

Posted by: peter.herschel on 16 April 2024, 11:04 pm EST

    • Post Options:
    • Link

    Posted 16 April 2024, 11:04 pm EST

    I have a page report that performs various complex calculations in a group footer within a table control.

    Rather than repeat the formula for each cell in the group footer, can I do sometime like: TextBox16.Value / 100 ? (Say TextBox16 is a cell in the group footer.)

    Can I assign a calculation result to a variable or something?

    Finally I need to summarize the results of the calculations at the end of the report and was hoping I could leverage the values the group footer calculates by simply summing the footer results.

    If you could point me in the right direction I would appreciate it.

    Thanks

  • Posted 17 April 2024, 6:30 pm EST

    Hi Peter,

    You can define your formula in the Script tab of your report and then you can reuse the method in any TextBox by calling the method name of your formula.

    However, if you want to show the TextBox value in another TextBox then you can use the expression: ‘=ReportItems![TextBoxName].Value’. However, if the TextBox value that you are accessing does not have a value by the time the control is fetching for its data or the TextBox renders after the control is rendered that fetches for its data then the result may vary.

    Please find attached a sample implementing the same.

    Regards,

    Anand

    ExpressionsReport.zip

  • Posted 18 April 2024, 12:19 am EST

    That’s very helpful. I now calculate the complex values in the group footer with far less math. Is there a easy way to sum() a calculated result that appears in a group footer for the report footer?

    Thanks

  • Posted 18 April 2024, 1:29 am EST

    I think I stumbled on to a function that works for placing grand totals at the bottom of the report:

    =RunningValue(ReportItems!TextBox29.Value, SUM)

    TextBox29 is a cell in the group footer with a calculated result

  • Posted 18 April 2024, 7:54 pm EST

    Hi Peter,

    The ‘RunningValue’ fill adds a sum to the fields and does not work with ReportItems, to add your ReportItems value as a sum to a variable we suggest you declare a variable in your script section and add a method to add your ‘ReportItem’ value to that variable and a method to retrieve the value of your variable for the calculated result.

    Please find attached a sample implementing the same.

    Regards,

    Anand

    ExpressionsReportUpdated.zip

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels