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/LS_RCJJDDLFD.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 }); LSDAL dal = new LSDAL(); DataTable dt1 = dal.Get_LS_RCJJDDLFD(year, month); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_RCJJDDLFD", dt1)); DataTable dt2 = dal.Get_LS_RCJJDDLFDSum(year, month); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_RCJJDDLFDSum", dt2)); DataTable dt3 = dal.Get_LS_RCJJDDLFD_TuBiao(year, month); this.ReportViewer1.LocalReport.DataSources.Add(new ReportDataSource("DataSetForLS_RCJJDDLFDTuBiao", dt3)); this.ReportViewer1.LocalReport.Refresh(); }