Getting error on RDLC parameter not defined in this report

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • dbrewerton
    New Member
    • Nov 2009
    • 115

    Getting error on RDLC parameter not defined in this report

    Does anyone know what causes this problem? I have a winforms report viewer and I have declared the variables on the report. There are three, StartDate, EndDate, and PatientID. Here is my code:

    Code:
            public BPReport()
            {
                InitializeComponent();
                DateTime StartDate = DateTime.Today.AddDays(-30);
                DateTime EndDate = DateTime.Today.AddDays(0);
                BaseForm BForm = new BaseForm();
                string PatientID = BForm.PatientIDVal.ToString();
                reportViewer1.Clear();
                ReportParameter[] Param = new ReportParameter[3];
                Param[0] = new ReportParameter("StartDate", StartDate.ToString());
                Param[1] = new ReportParameter("EndDate", EndDate.ToString());
                Param[2] = new ReportParameter("PatientID", PatientID.ToString());
                this.reportViewer1.LocalReport.SetParameters(Param);
                this.reportViewer1.RefreshReport();
            }
    Any ideas?
Working...