private void BandingReports(string agentName, string startDate, string endDate) { ReportParameter[] parameters = new ReportParameter[2]; parameters[0] = new ReportParameter("startDate", startDate); parameters[1] = new ReportParameter("endDate", endDate); AgentRechargeBLL bll = new AgentRechargeBLL(context, loginSession); System.Data.DataSet ds = new DataSet(); ds = bll.GetDataSet(agentName, startDate, endDate); this.ReportViewer1.Reset(); this.ReportViewer1.LocalReport.ReportPath = @"Reports\AgentRecharge.rdlc"; this.ReportViewer1.LocalReport.DisplayName = "代理商充值"; this.ReportViewer1.LocalReport.SetParameters(parameters); ReportDataSource rds = new ReportDataSource("AgentRechargeDataSet", ds.Tables[0]); this.ReportViewer1.LocalReport.DataSources.Add(rds); this.ReportViewer1.LocalReport.Refresh(); }