locked
Crystalreportviewer in VS 2013 - no parameter prompting RRS feed

  • Question

  • User-106241125 posted

    I have a VS 2013 VB Web Forms project using the Crystalreportviewer control. I use the control to call crystal.rpt files. If I call a .rpt file that doesn't have any parameters, the report runs and displays the data no problem. If I call a .rpt file that does have parameters, the report appears to run, I don't get prompted for parameters, and the control/report comes up blank. What am I doing wrong ???

    Here's my code.

    ASPX

    <CR:CrystalReportSource ID="CrystalReportSource1" runat="server" EnableCaching="false"></CR:CrystalReportSource>
    
    <CR:CrystalReportViewer 
            ID="CrystalReportViewer1" 
            runat="server" 
            AutoDataBind="true"  
            EnableDatabaseLogonPrompt="false" 
            EnableParameterPrompt="true" 
            HasRefreshButton="True"                             
            ReportSourceID="CrystalReportSource1" />

    VB Code Behind

    strReport = "C:\MyLocalPath\PeteTestReport.rpt"
               
    CrystalReportViewer1.ReportSource = strReport
    CrystalReportViewer1.RefreshReport()       


    Note: I have already copied the 'crystalreportviews13' folder from C:\inetpub\wwwroot\asp_client folder to my application folder to fix the infamous BOBJ script error.

    Thanks

    Pete

    Friday, May 6, 2016 1:07 PM

All replies

  • User614698185 posted

    Hi Pete,

    If you want to pass parameter to crystal report, you could refer to the below code:

    ReportDocument reportDocument = new ReportDocument();
    reportDocument.Load(reportPath);
    reportDocument.SetParameterValue("@id", QuotationID);

    For more information about passing parameter to the CrystalReportSource, please see:

    https://msdn.microsoft.com/en-us/library/ms227827(v=vs.80).aspx

    Best Regards,

    Candice Zhou

    Monday, May 9, 2016 2:06 AM
  • User-1716253493 posted

    Maybe you have set the parameters values already or it has default value

    Monday, May 9, 2016 2:45 AM