我试图将2个水晶报告合并为单个pdf文件,我正在使用Itextsharp v5.1.1.但它说文件无法打开.它可能已损坏.没有构建错误.但pdf格式不正确,无法打开.这是我选择完成此任务的顺序.
以下是订单中每个步骤的代码.
/// Get the Dataset from Stored Procedure for the CSSource Report
dsCS = CSData.GetUSSourceXML(ds_input);
/// Create the Report of type CSsource
rptCS = ReportFactory.GetReport(typeof(CSsource));
rptCS .SetDataSource(dsCS);
/// Set the Parameters to the CS report
rptCS .ParameterFields["Parameterid"].CurrentValues.Clear();
rptCS .SetParameterValue("Parameterid", PID);
//// Serialize the Object as PDF
msCS=(MemoryStream)rptCS .ExportToStream(ExportFormatType.PortableDocFormat);
Run Code Online (Sandbox Code Playgroud)
对于第2步
/// Get the Dataset from Stored Procedure for the Aden Report
dsAd = CSData.GetAdden(ds_input);
/// Create the Report of type Aden
rptAd = ReportFactory.GetReport(typeof(Aden));
rptAd.SetDataSource(dsAd …Run Code Online (Sandbox Code Playgroud)