locked
Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX)) RRS feed

  • Question

  • User895750205 posted

    Hello people,

    Getting this error when trying to run a report using parameters from a form. The code segment is as follows:

    protected void PrintButton_Click(object sender, EventArgs e)
    {
    CrystalReport1 aReport = new CrystalReport1();
    ParameterDiscreteValue paramDoc_no = new ParameterDiscreteValue();
    aReport.Load(Server.MapPath(@"CrystalReport1.rpt"));
    aReport.FileName = Server.MapPath(@"CrystalReport1.rpt");
    aReport.SetParameterValue("@OrderCode", Doc_no.Text);
    CrystalReportViewer1.ReportSource = aReport;
    CrystalReportViewer1.DataBind();
    CrystalReportViewer1.Visible = true;
    }
    
    
    I get the error at SetParameterValue. 
    Please help.
    Regards
    Monday, October 10, 2011 9:11 AM

All replies

  • User-2028009415 posted

    hi

        Check ur Paramter name(@OrderCode) in that crystal report  

     

    If I have misunderstood anything, please feel free to let me know.

    Regards

    S.Mohamed Faisal

    Please remember to mark the replies as answers if they help.

    Monday, October 10, 2011 10:51 AM
  • User895750205 posted

    Hi there,

    Thanks for the reply. I know there is some problem in the crystal report parameter but can't figure out what. The Parameter name is

    OrderCode all right - defined in Parameter Fields as OrderCode.

    Tried to upload a screen shot but the forum does not allow it seems )-:

    Regards

    Tuesday, October 11, 2011 12:57 AM