[英]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.