Output as Image (C#)

Set up and configure output to an image file from your reporting application. This option is useful for archiving.


This code snippet shows some of the properties and methods available for an object of the ImageRenderer class:

// code snippet starts

   String designFile = "OrderReport.4rp";

ImageRenderer renderer = new ImageRenderer();

//Configuring the Image output:
renderer.fileType ="png";
renderer.fileNamePrefix= "my_image_";
renderer.fromPage = 1;
renderer.toPage = 3;

FourRpLayouter report = new FourRpLayouter(designFile, renderer1);

//Run the report 
report.debugLevel =9;

// some code omitted - view full source in demo


// code snippet ends
In this example:
  • An object named renderer is defined using the ImageRenderer class.
  • The fileType property sets the output format. In this example, the files created are .png image files.
  • The fromPage property sets the first page to be included and the toPage property sets the last page to be included in the output. In this example, three pages of the report will be printed, starting with page 1 and ending with page 3. An image file will be created for each page.
  • The fileNamePrefix property sets the prefix for the image files created. In this example, the name of an image file will start with " my_image_", followed by a sequential number: my_image_0001.png, my_image_0002.png, and my_image_0003.png.
  • FourRpLayouter report = new FourRpLayouter(designFile, renderer1) creates the FourRpLayouter object for the specified report file that outputs to the given consumer object.

For the full list of properties and methods for this renderer class, refer to the Genero Report Writer .NET API documentation.