[英]Crystal Reports ASP.NET Export PDF as Multiple Pages
我使用 CR 导出 PDF 文件,根据我从 ASP.NET Web Z6450242Z68531912328A863 应用程序发送的参数在当前情况下,我可以导出一页 PDF 但我想添加更多具有不同信息的页面。
当前情况:当我从我的 ASP.NET 应用程序中导出 PDF
我试图实现的目标:具有不同信息但格式相同的不同页面
总之,我正在尝试在 for 循环中添加页面,是否可以以相同的格式添加不同的页面?
我的 CR 报告: CR 报告
我在 ASP.NET Web Forms 应用程序中的代码:(代码中的 dt 数据表实际上有更多行,但我找不到如何在上面的示例中显示每个记录)
ReportDocument reportDocument = new ReportDocument();
reportDocument.Load(Server.MapPath(@"Report\MyReportFile.rpt"));
DataTable dt = new DataTable();
dt = new DummyDL().PROCEDURE_GET_DUMMY_DATA(DUMMY_NO);
reportDocument.SetParameterValue("P_DUMMY", DUMMY);
reportDocument.SetParameterValue("P_DUMMY1", Convert.ToString(dt.Rows[0]["DUMMY1"]));
reportDocument.SetParameterValue("P_DUMMY2", Convert.ToString(dt.Rows[0]["DUMMY2"]));
reportDocument.SetParameterValue("P_DUMMY3", Convert.ToString(dt.Rows[0]["DUMMY3"]));
PrintOptions printOptions = reportDocument.PrintOptions;
ExportOptions exportOpts = new ExportOptions();
PdfFormatOptions pdfOpts = ExportOptions.CreatePdfFormatOptions();
exportOpts.ExportFormatType = ExportFormatType.PortableDocFormat;
exportOpts.ExportFormatOptions = pdfOpts;
reportDocument.ExportToHttpResponse(exportOpts, Response,false, "");
if (!IsPostBack) CrystalReportViewer1.Error += new ErrorEventHandler(CrystalReportViewer1_Error);
CrystalReportViewer1.ReportSource = reportDocument;
CrystalReportViewer1.DataBind();
只需将其他页面的数据添加到数据源。
例如,如果您通过传递 OrderID 参数并应用基于该参数的记录选择来将数据限制为一个订单,请更改该参数以允许多个值。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.