protected void BindReportDataSource() { DateTime start = Convert.ToDateTime(this.StartDate.Text); DateTime end = Convert.ToDateTime(this.EndDate.Text); string center = (this.Center.Text).ToString(); string station = (this.Station.Text).ToString(); string name = (this.Name.Text).ToString(); string workCode = (this.WorkCode.Text).ToString(); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/TJ_JJRYGZXL.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", start1); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", end1); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); TJDAL dal = new TJDAL(); DataTable dt = dal.Get_JJRYGZXL(start, end,center,station, name, workCode); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_JJRYGZXL", dt)); this.ReportViewer1.LocalReport.Refresh(); }