0
我試圖將PDF文件從Crystal導出到流,然後我想使用DotNetZip庫將它們添加到一個zip文件中。我只是想在下面添加一個。我有一種感覺,我走了。請幫忙。將多個水晶報告pdfs添加到壓縮文件
MemoryStream oStream;
CrystalDecisions.CrystalReports.Engine.ReportDocument rpt = new CrystalDecisions.CrystalReports.Engine.ReportDocument();
if (a2batch.Count > 0) // a2batch - My Crystal Datasource List
{
rpt.Load(Server.MapPath("~\\Report\\Construction\\ScheduleA2.rpt"));
rpt.SetDataSource(a2batch);
oStream = (MemoryStream)rpt.ExportToStream(ExportFormatType.PortableDocFormat);
using (ZipFile zipFile = new ZipFile())
{
zipFile.AddEntry("Report.pdf", oStream);
zipFile.Save("Report.zip");
}
}