protected void BindReportDataSource() { string year = (this.Year.Text).ToString(); string month = (this.Month.Text).ToString(); this.ReportViewer1.LocalReport.DataSources.Clear(); this.ReportViewer1.LocalReport.ReportPath = Server.MapPath(@"~/Reports/TJ_YWSJFD.rdlc"); Microsoft.Reporting.WebForms.ReportParameter st = new Microsoft.Reporting.WebForms.ReportParameter("StartTime", year); Microsoft.Reporting.WebForms.ReportParameter ed = new Microsoft.Reporting.WebForms.ReportParameter("EndTime", month); this.ReportViewer1.LocalReport.SetParameters(new Microsoft.Reporting.WebForms.ReportParameter[] { st, ed }); TJDAL dalt = new TJDAL(); DataTable dt = dalt.Get_YWSJFD(year, month); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_YWSJFD", dt)); this.ReportViewer1.LocalReport.Refresh(); }