因为3.0确实太老,这边没法进行测试,您是要实现pdf导出的功能吗,可以参考如下代码- private void Form1_Load(object sender, EventArgs e)
- {
- GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport(new System.IO.FileInfo(@"***.rdlx"));
- GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(report);
- //导出目录
- System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"D:\AR\export\MyExcel");
- outputDirectory.Create();
- 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();
- GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension("这里定义文件名字"));
- outputProvider.OverwriteOutputFile = true;
- var printOptions = new NameValueCollection();
- printOptions.Add("PrinterName", "PrinterName");
- report.Document.Render(pdfRenderingExtension, outputProvider, pdfSetting);
- }
复制代码
|