Passing values from subReport to MainReport doesn't work on flexReports

Posted by: iqoperations on 24 February 2021, 4:00 am EST

  • Posted 24 February 2021, 4:00 am EST


    According to the documentation here

    Retrieving Values from Subreports (

    It is possible to pass values from subReport to mainReport by reading from mainReport, those directly from the subReport. (and vice versa)

    We used to use the expression MyReport.Subreport.Fields("MyField").value or MySubReport.ParentReport.Fields("MyFields").value to read those values in our C1Reports

    When we migrated to FlexReports, these expressions were returning nothing.

    I can reproduce the issue using a template bound to a sql datasource and previewing the report in the designer.

    Could you please help understanding what broke here ?


    C1FlexReportDesigner.4.5.2, Version 4.5.20203.468

    C1.WPF.FlexReport 4.5.20201.697
  • Replied 24 February 2021, 9:09 pm EST

    Please try to use below syntax to achieving your requirement:
    Retrieving value from SubReport (Detail.OnFormat):

    Retrieving value from MainReport(Header.OnFormat):

    Please find a sample report attached. You can change the event and script based on your requirement.

    If this does not work for you. Please share a small sample to reproduce the issue so that we can assist you accordingly.

  • Replied 25 February 2021, 6:50 am EST


    Thanks for your reply

    It is indeed working on your case but i was referring to the case when the reports are data bound to e.g sql datasource

    I can anyway reproduce the undesired behaviour on the attached sample.

    If you attach customers.xml as the main datasource of the subreport and try to render mainReport, you will see that the fields are not retrieved.
  • Marked as Answer

    Replied 25 February 2021, 8:53 pm EST

    Thank you for sharing a sample report with us.
    This is the desired behavior of C1FlexReport that we cannot get the the value of a sub report field (bind to data source) . If we want to get a sub report field value in our main report then we need to create a field in sub report which is not bind to any data source field.
    However, in our old C1Report, it returns the field label (data source field name).


Need extra support?

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

Learn More

Forum Channels