Image is the format that converts your report to an image file. You can use the ImageRenderingExtension to render your report in this format. Make sure that you select an ImageType to any of the six different image formats available: BMP, GIF, JPEG, TIFF, and PNG.
To render the entire report as a single image, set the Pagination setting to False.
ActiveReports offers several options to control how reports render to Image.
Property | Description |
---|---|
Compression | Sets or returns a value which specifies the compression to be used when exporting. |
Dither | Specifies whether the image should be dithered when saving to a black and white output format, like CCITT3 or Rle. This property has no effect if the CompressionScheme property is set to Lzw or None(represents color output). |
DpiX | Adjust the horizontal resolution of rendered images. The default value is 96. |
DpiY | Adjust the vertical resolution of rendered images. |
ImageType | Select the type of image to which you want to render the report. Supported types are BMP, GIF, JPEG, TIFF, and PNG. |
Pagination | By default, each page of a report is rendered as a separate image. Set this value to False to render the entire report as a single image. |
Quality | Gets or sets the quality of the report to be rendered as a JPEG image. |
Reports rendered as images do not support any of the interactive features of Active Reports. Any data hidden at the time of export is hidden in the image. To display all data in a drill-down report, expand all toggle items prior to exporting.
The following steps provide an example of rendering a report in Image format.
Visual Basic.NET code. Paste INSIDE the Form Load event. |
Copy Code
|
---|---|
' Provide the Page report you want to render. Dim rptPath As New IO.FileInfo("..\..\PageReport1.rdlx") Dim pageReport As New GrapeCity.ActiveReports.PageReport(rptPath) ' Create an output directory. Dim outputDirectory As New System.IO.DirectoryInfo("C:\MyImage") outputDirectory.Create() ' Provide settings for your rendering output. Dim imageSetting As New GrapeCity.ActiveReports.Export.Image.Page.Settings() Dim setting As GrapeCity.ActiveReports.Extensibility.Rendering.ISettings = imageSetting ' Set the rendering extension and render the report. Dim imageRenderingExtension As New GrapeCity.ActiveReports.Export.Image.Page.ImageRenderingExtension() Dim outputProvider As New GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name)) ' Overwrite output file if it already exists. outputProvider.OverwriteOutputFile = True pageReport.Document.Render(imageRenderingExtension, outputProvider, imageSetting) |
C# code. Paste INSIDE the Form Load event. |
Copy Code
|
---|---|
// Provide the Page report you want to render. 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:\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; pageReport.Document.Render(imageRenderingExtension, outputProvider, imageSetting); |