调用api生成pdf的过程中报错Could not load file or assembly 'Gcef.Data.DataEngine, Version=2.0.184.0,项目中 已经引用了Gcef.Data.DataEngine这个dll版本也是对的.
以下是代码
- System.IO.FileInfo rptPath = new System.IO.FileInfo(@"C:\Users\User\Desktop\A.rdlx");
- GrapeCity.ActiveReports.PageReport pageReport = new GrapeCity.ActiveReports.PageReport(rptPath);
- pageReport.Report.ReportParameters[0].DefaultValue.Values.Add("34085730");
- // Create an output directory.
- System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"D:\AA");
- outputDirectory.Create();
- // Provide settings for your rendering output.
- GrapeCity.ActiveReports.Export.Pdf.Page.Settings pdfSetting = new GrapeCity.ActiveReports.Export.Pdf.Page.Settings();
- // 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, "123");
- // Overwrite output file if it already exists
- outputProvider.OverwriteOutputFile = true;
- pageReport.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);
复制代码
|