Click here to Skip to main content
15,896,557 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
This will occur when I write this code which is shown below:

{
  ReportDocument report = new ReportDocument();
  report.Load(MapPath("Report1.rpt"));
  report.SetParameterValue("@FromDate", TextBox1.Text);
  report.SetParameterValue("@ToDate", TextBox2.Text);
  CrystalReportViewer1.ReportSource = report;
}
Posted
Updated 29-Oct-10 21:33pm
v3

Double check the parameter names. That's usually the biggest cause for this error.
 
Share this answer
 
v2
See here[^].
 
Share this answer
 
Probably you should set the parameter name without "@" when using Crystal Report. Maybe it's an old post but it may be helpful for others who still need a solution for this problem.

report.SetParameterValue("FromDate", TextBox1.Text);

instead of
report.SetParameterValue("@FromDate", TextBox1.Text);

Give it a go.
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900