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_SLQKFZ.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 dal = new TJDAL(); DataTable dt = dal.Get_SLQKFZ(year, month); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForTJ_SLQKFZ", dt)); this.ReportViewer1.LocalReport.Refresh(); }