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:
Any ideas?
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();
}