您好,您导出换一种导出的方式看看,我们的导出有两种方式一种是Export Filters 还有一种就是Rendering Extensions
相对来说Rendering这种方式更加可靠,更加适合导出。
具体可参考如下代码:System.IO.FileInfo rptPath = new System.IO.FileInfo(@"..\..\PageReport1.rdlx");GrapeCity.ActiveReports.PageReport pageReport = new GrapeCity.ActiveReports.PageReport(rptPath);// Create an output directory.System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyPDF");outputDirectory.Create();// Provide settings for your rendering output.GrapeCity.ActiveReports.Export.Pdf.Page.Settings pdfSetting = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();// Reduce the report size and report generation time.pdfSetting.OptimizeStatic = true;// Set the rendering extension and render the report.GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension pdfRenderingExtension = new GrapeCity.ActiveReports.Export.Pdf.Page.PdfRenderingExtension();GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));// Overwrite output file if it already existsoutputProvider.OverwriteOutputFile = true;pageReport.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);
|