您好,
导出功能是自定义实现的,您可以查看在线示例源码里面的Export.aspx文件。
具体您可以查看已pdf为例
- protected void btnPdf_Click(object sender, EventArgs e)
- {
- // Provide the page report you want to render.
- string report = "rptInvoice";
- GrapeCity.ActiveReports.PageReport _reportDef = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(Server.MapPath("~/Reports/" + report + ".rdlx")));
- _reportDef.Report.DataSources[0].DataSourceReference = "";
- _reportDef.Report.DataSources[0].ConnectionProperties.DataProvider = "OLEDB";
- _reportDef.Report.DataSources[0].ConnectionProperties.ConnectString = string.Format("Provider=Microsoft.Jet.OLEDB.4.0;Data Source={0};", Server.MapPath("~/Data/NWind_CHS.mdb"));
- GrapeCity.ActiveReports.Document.PageDocument _reportRuntime = new GrapeCity.ActiveReports.Document.PageDocument(_reportDef);
- // Create an output directory
- System.IO.MemoryStream ms = new System.IO.MemoryStream();
- // Provide settings for your rendering output.
- GrapeCity.ActiveReports.Export.Pdf.Page.Settings pdfSetting = new
- GrapeCity.ActiveReports.Export.Pdf.Page.Settings();
- GrapeCity.ActiveReports.Extensibility.Rendering.ISettings setting = pdfSetting;
- //Set the rendering extension and render the report.
- GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension pdfRenderingExtension =
- new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
- GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.MemoryStreamProvider();
- _reportRuntime.Render(pdfRenderingExtension, outputProvider, pdfSetting);
- Response.ContentType = "application/pdf";
- Response.AddHeader("content-disposition", "inline;filename=客户订单.pdf");
- outputProvider.GetPrimaryStream().OpenStream().CopyTo(ms);
- Response.BinaryWrite(ms.ToArray());
- Response.End();
- }
复制代码
我测试了一下,演示版的导出是可以导出的。AR对环境的要求:
http://www.gcpowertools.com.cn/products/activereports_specs.htm
|