Conversion from C1Reports to FlexReport Parameter Passing

Posted by: Matthew.Peitz on 21 January 2021, 1:23 am EST

  • Posted 21 January 2021, 1:23 am EST


    We are in the process of upgrading from C1Reports to FlexReports. In C1Reports we would use vb script in onFormat to set the record source for subreports to pull back data for the individual portion. I believe in FlexReport we can get around this by setting parameters in the sub report section. But I can't find any documentation on how to pass a value returned on the master report (but not in a field) to a subreport parameter?

    Is this possible?
  • Replied 21 January 2021, 8:20 pm EST

    Hi Matt,

    You can pass parameters to the SubReport, just add the parameter to the ReportParameterValues using the ParameterValues property of the SubReportField. Then you can use this ReportParameterValue to set the value of the parameter in the Detail.OnFormat script like the following:

    Field1.ParameterValues(0).Value = 3

    Please refer to the video at and the sample report attached.

    You can also refer to which explains the same.

  • Replied 25 January 2021, 1:22 am EST

    Yes I see how to pass a parameter. But Who do I pass a value from the main query to a sub report.

    So let's say main query returns 3 ids id1, id2, id3. How do I set Field1.ParameterValues(0).Value = id1?
  • Marked as Answer

    Replied 26 January 2021, 5:24 pm EST


    You can assign a field of the data to the parameter, for example, if a master report has order details and has multiple records and the subreport has the product details, you can just assign the "ProductID" field to the parameter and for every record, the value will be passed to the parameter. Please refer to the gif attached.

    You can also set the parameter value in the Detail.OnFormat script like the following:
    Field5.ParameterValues(0).Value = ProductID

    Please refer to the sample report attached. If you have any questions, please let us know.

    Prabhat Sharma.
Need extra support?

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

Learn More

Forum Channels