No value for one or more required parameters

Posted by: mwebster on 18 December 2018, 9:42 am EST

    • Post Options:
    • Link

    Posted 18 December 2018, 9:42 am EST

    I have a Flex Report with two parameters (StartDate and EndDate). I am calling the report, setting the connection string and setting those values in code using the following code:

        Dim rptPath As String = System.IO.Path.GetDirectoryName(System.Reflection.Assembly.GetExecutingAssembly().GetName().CodeBase) & "\Reports\UsageSummaryReport.flxr"
        Dim ConnStr As String = "Provider=sqloledb;" & ConnString
        C1FlexReport1.Load(rptPath, "UsageSummaryReport")
        C1FlexReport1.DataSource.ConnectionString = ConnStr
        C1FlexReport1.Parameters.Item("StartDate").Value = StartDate
        C1FlexReport1.Parameters.Item("EndDate").Value = EndDate
        Try
            C1FlexViewer1.DocumentSource = C1FlexReport1
        Catch ex As Exception
            MsgBox(ex.ToString)
        End Try
    

    When the report runs I get the error “No value for one or more required parameters”

    There are no other parameters other than the two that I set and I have verified that the variables being passed contain valid values. If I preview the report in the designer and enter the parameter values, it works just fine. Any ideas?

  • Posted 19 December 2018, 5:54 am EST

    Hello,

    As you confirm that no other parameter exists in your report that might be missing a value (main cause of the stated error), please refer the below mentioned forum thread wherein the issue is resolved when the database is updated:

    https://www.grapecity.com/en/forums/winforms-edition/no-value-for-one-or-more-r

    Further, I created the same scenario at my end using C1NWind’s Appointees table. It executes without any issue. In case this does not help, kindly modify the attached sample and share it back so that I can observe the issue and assist you further.

    Regards,

    Eshaprj_C1FlexReport_Parameters.zip

Need extra support?

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

Learn More

Forum Channels