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.FileName = Server.MapPath(@"CrystalReport1.rpt");
    aReport.SetParameterValue("@OrderCode", Doc_no.Text);
    CrystalReportViewer1.ReportSource = aReport;
    CrystalReportViewer1.Visible = true;
    I get the error at SetParameterValue. 
    Please help.
    Monday, October 10, 2011 9:11 AM

All replies

  • User-2028009415 posted


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


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


    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 )-:


    Tuesday, October 11, 2011 12:57 AM