Nitol Biswas

Nitol Biswas

  • NA
  • 173
  • 28.7k

Invalid index. (Exception from HRESULT: 0x8002000B )

Feb 5 2017 12:47 AM
When I try to load my Crystal report the following error is happened.
 
Invalid index. (Exception from HRESULT: 0x8002000B (DISP_E_BADINDEX))
 
Here is my Code:
 
ReportDocument cryRpt = new ReportDocument();
cryRpt.Load(@"C:\IFAD-Reports\CrystalReportDemo.rpt");
ParameterFieldDefinitions crParameterFieldDefinitions;
ParameterFieldDefinition crParameterFieldDefinition;
ParameterValues crParameterValues = new ParameterValues();
ParameterDiscreteValue crParameterDiscreteValue = new ParameterDiscreteValue();
crParameterDiscreteValue.Value = textBox1.Text;
crParameterFieldDefinitions = cryRpt.DataDefinition.ParameterFields;
crParameterFieldDefinition = crParameterFieldDefinitions["Product"];
crParameterValues = crParameterFieldDefinition.CurrentValues;
crParameterValues.Clear();
crParameterValues.Add(crParameterDiscreteValue);
crParameterFieldDefinition.ApplyCurrentValues(crParameterValues);
crystalReportViewer1.ReportSource = cryRpt;
crystalReportViewer1.Refresh(); 
 
How can I fix this problem please help.
 
 

Answers (1)