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); string name = (this.Name.Text).ToString(); string workCode = (this.WorkCode.Text).ToString(); string type = (this.DropDownList_Type.Text).ToString(); string start1 = start.ToString(); string end1 = end.ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/TJ_FYSJ.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_TJ_FYSJ(start, end, center, station, name, workCode, type); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FYSJ", dt)); DataTable dt1 = dal.Get_TJ_FYSJ_CenterTime(start, end, station, name, workCode,type); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_FYSJ_CenterTime", dt1)); this.ReportViewer1.LocalReport.Refresh(); }