C1Flexreport passing parameter from Main report to Subreport

Posted by: jay on 5 October 2020, 2:36 pm EST

    • Post Options:
    • Link

    Posted 5 October 2020, 2:36 pm EST

    Looking for direction on passing a parameter from the main report to the subreport. I have the parameter passing to the main report successfully, I just can’t get it to pass through to the subreport. If I manually enter the parameter in the subreport the results show as expected.

  • Posted 6 October 2020, 6:03 am EST

    Hi Jay,

    You can use the SubReport’s Tag property to pass the data from the Main Report to the SubReport.

    I have attached a demo report implementing the same, if you are doing anything else then please share a stripped down sample or just modify the attached report.

    Regards,

    Prabhat Sharma.

    demoReport.flxr.zip

  • Posted 7 October 2020, 12:12 pm EST

    What I’m trying to do is pass through a parameter passed to the main report and pass the parameter into the Datasource SQL statement for the subreport. Below is some code I found but it looks to be MS Access, We Are using MS SQL server.

    Closest I’ve found for documentation for C1Reports - we are using the C1FlexReport

    https://www.grapecity.com/blogs/parameter-handling-in-c1reports/

    Section:

    2. Passing Parameters from Main-Report to Sub-Report:

    Field38.Subreport.DataSource.RecordSource = “PARAMETERS” & vbCrLf & "SubMinUnitPrice single " & MinUnitPrice & “;” & vbCrLf & “select * from Products where UnitPrice > [SubMinUnitPrice]”

  • Posted 8 October 2020, 8:20 am EST

    Hi Jay,

    Please find the attached report file implementing the same. If you are doing anything else then please modify the report accordingly so that we can assist you better.

    Regards,

    Prabhat Sharma.

    SampleParamsToSubReport (2).zip

Need extra support?

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

Learn More

Forum Channels