您好这是导出图片的代码:
- // Provide the page report you want to render.
- GrapeCity.ActiveReports.PageReport report = new GrapeCity.ActiveReports.PageReport();GrapeCity.ActiveReports.Document.PageDocument reportDocument = new GrapeCity.ActiveReports.Document.PageDocument(report);
- // Create an output directory.
- System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyImage");
- outputDirectory.Create();
- // Provide settings for your rendering output.
- GrapeCity.ActiveReports.Export.Image.Page.Settings imageSetting = new GrapeCity.ActiveReports.Export.Image.Page.Settings();
- GrapeCity.ActiveReports.Extensibility.Rendering.ISettings setting = imageSetting;
- // Set the rendering extension and render the report.
- GrapeCity.ActiveReports.Export.Image.Page.ImageRenderingExtension imageRenderingExtension = new GrapeCity.ActiveReports.Export.Image.Page.ImageRenderingExtension();
- 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 exists.
- outputProvider.OverwriteOutputFile = true;
- reportDocument.Render(imageRenderingExtension, outputProvider, imageSetting);
复制代码 导出的名字就是这个MyImag
|