Flexreport: SUM(FieldName) Not Working In Footer Section of Sub Report

Posted by: mwebster on 17 September 2018, 3:59 pm EST

    • Post Options:
    • Link

    Posted 17 September 2018, 3:59 pm EST

    I have a weird situation with a report. My report contains a sub report. In the footer section, I have a text field and the Expression is set to Sum([FieldName]). The field in question contains numeric values but shows up blank when the report is printed. Any ideas?

  • Posted 18 September 2018, 1:46 am EST

    Hello,

    In C1FlexReport, we do not correctly calculate aggregates which reference report (as opposed to db) fields, because doing so would adversely affect rendering performance.

    In order to achieve correct values, you can use any of the following methods:

    1. Set subreport’s BehaviorOptions.EnableAggregatesOnReportFields property to true (screenshot attached).

      or,
    2. Apply aggregate function on DB field

      Example: In case of the attached report, set Text of SumCtl field in subreport’s footer to sum(ReorderLevel.Value) instead of sum(ReorderLevelCtl.Value).

    Hope it helps.

    Best Regards,

    Esha

    SubReport Files.zip

  • Posted 18 September 2018, 11:04 am EST

    Thanks for the reply. I have actually tried it with both database and repot fields but I will give your suggestion a try.

    Mike

  • Posted 18 September 2018, 11:47 am EST

    Thanks Esha, that did the trick. I used the EnableAggregatesOnReportFields property and it worked. Reason the database field did not work was I was not using .value - e.g. dbfield.value

    Mike

Need extra support?

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

Learn More

Forum Channels