附件中是我写的代码,请帮忙看一下
- protected void WebViewer1_LocateDataSource(object sender, LocateDataSourceEventArgs args)
- {
-
- string[] Parameters = new string[10];
- for (int i = 0; i < args.Report.Parameters.Count; i++)
- {
- Parameters[i] = args.Report.Parameters[i].Label;
- }
- Session["report_Parameters"] = Parameters;
- args.Data = GetReportDataSet();
- }
复制代码
执行后前台显示了报表并且后台记录了参数,当用户点《导出EXCEL》时 执行如下代码
- protected void Button1_Click(object sender, EventArgs e)
- {
- GrapeCity.ActiveReports.PageReport _reportDef =
- new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath("000002.rdlx")));
- GrapeCity.ActiveReports.Document.PageDocument prpt =
- new GrapeCity.ActiveReports.Document.PageDocument(_reportDef);
- prpt.LocateDataSource +=
- new GrapeCity.ActiveReports.LocateDataSourceEventHandler(Document_LocateDataSource);
- ExportExcel(this.Context, _reportDef);
- }
复制代码
但提示数据集没有设置 请问这里的数据集怎么设置呢? |