Below is a copy of my code. I am receiving a Load Report Failed at crReport.DataDefinition.ParameterFields[0].ApplyCurrentValues(values0);
Any ideas?
CrystalDecisions.Shared.ParameterDiscreteValue pdv = new CrystalDecisions.Shared.ParameterDiscreteValue();
CrystalDecisions.CrystalReports.Engine.ReportDocument crReport = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
crReport.FileName = "Report1.rpt"; ;
crReport.Load(@"C:\Apps\Web\TestCFML\" + crReport.FileName, OpenReportMethod.OpenReportByDefault);
//this.CrystalReportViewer1.ReportSource = Server.MapPath("report1.rpt");
this.CrystalReportViewer1.ReportSource = @"C:\Apps\Web\TestCFML\" + crReport.FileName;
ParameterValues values0 = new ParameterValues();
pdv.Value =
"MIA";
values0.Add(pdv);
crReport.DataDefinition.ParameterFields[0].ApplyCurrentValues(values0);
ParameterValues values1 = new ParameterValues();
pdv.Value =
DateTime.Now.AddDays(-6);
values1.Add(pdv);
crReport.DataDefinition.ParameterFields[1].ApplyCurrentValues(values1);
ParameterValues values2 = new ParameterValues();
pdv.Value =
DateTime.Now;
values2.Add(pdv);
crReport.DataDefinition.ParameterFields[2].ApplyCurrentValues(values2);
ParameterValues values3 = new ParameterValues();
pdv.Value =
"TEST";
values3.Add(pdv);
crReport.DataDefinition.ParameterFields[3].ApplyCurrentValues(values3);