版主好:
我想实现多个RDL报表在网页上以PDF合并的形式展现,我的AR版本为9.2
官网上的参考是要将存在本地的PDF合并的实例,但我现在只是需要展示出来,并不需要保存,代码为如下,请看下红色部分的合并该怎么写?谢谢
PageReport rpt = new PageReport();
rpt.Load(new System.IO.FileInfo(Server.MapPath("~") + @"\RPT\" + rptName));
rpt.Report.ReportParameters[0].DefaultValue.Values.Clear();
rpt.Report.ReportParameters[0].DefaultValue.Values.Add(taskId);
try
{
rpt.Run();
}
catch (GrapeCity.ActiveReports.ReportException eRunReport)
{
// Failure running report, just report the error to the user.
Response.Clear();
Response.Write("<h1>Error running report:</h1>");
Response.Write(eRunReport.ToString());
return;
}
PageReport rpt1 = new PageReport();
rpt1.Load(new System.IO.FileInfo(Server.MapPath("~") + @"\RPT\" + rptName));
rpt1.Report.ReportParameters[0].DefaultValue.Values.Clear();
rpt1.Report.ReportParameters[0].DefaultValue.Values.Add(taskId);
try
{
rpt1.Run();
}
catch (GrapeCity.ActiveReports.ReportException eRunReport)
{
// Failure running report, just report the error to the user.
Response.Clear();
Response.Write("<h1>Error running report:</h1>");
Response.Write(eRunReport.ToString());
return;
}
Response.ContentType = "application/pdf";
Response.AddHeader("content-disposition", "inline; filename=MyPDF.PDF");
PdfExport pdf = new PdfExport();
System.IO.MemoryStream memStream = new System.IO.MemoryStream();
pdf.Export(rpt.Document, memStream);
pdf.Export(rpt1.Document, memStream);
Response.BinaryWrite(memStream.ToArray());
Response.End();
|
|