AR15模版,预览时正常。但是导出excel、word时异常。
模版预览数据时:
excel:(图片压边严重)
word:(页眉页脚异常,图片也有压边现象)
pdf完全正常:
excel、word、pdf均为后台代码导出:
case "xlsx":
DirectoryInfo outputDirectory = new DirectoryInfo(HttpRuntime.AppDomainAppPath + "temFile\\");
GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings excelSetting = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtensionSettings();
excelSetting.FileFormat = GrapeCity.ActiveReports.Export.Excel.Page.FileFormat.Xlsx;
excelSetting.MultiSheet = false;
excelSetting.Pagination = false;
GrapeCity.ActiveReports.Extensibility.Rendering.ISettings setting = excelSetting;
GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension excelRenderingExtension = new GrapeCity.ActiveReports.Export.Excel.Page.ExcelRenderingExtension();
GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, FileName);
outputProvider.OverwriteOutputFile = true;
rpt.Document.Render(excelRenderingExtension, outputProvider, setting.GetSettings());
case "pdf":
outputDirectory = new DirectoryInfo(HttpRuntime.AppDomainAppPath + "temFile\\");
GrapeCity.ActiveReports.Export.Pdf.Page.Settings pdfSetting = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();
GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension pdfRenderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();
outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, FileName);
outputProvider.OverwriteOutputFile = true;
rpt.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);
case "docx":
outputDirectory = new DirectoryInfo(HttpRuntime.AppDomainAppPath + "temFile\\");
GrapeCity.ActiveReports.Export.Word.Page.Settings wordSetting = new GrapeCity.ActiveReports.Export.Word.Page.Settings();
wordSetting.FileFormat = GrapeCity.ActiveReports.Export.Word.Page.FileFormat.OOXML;
GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension wordRenderingExtension = new GrapeCity.ActiveReports.Export.Word.Page.WordRenderingExtension();
outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, FileName);
outputProvider.OverwriteOutputFile = true;
rpt.Document.Render(wordRenderingExtension, outputProvider, wordSetting);
|