Output as Image (C#)
Set up and configure output to image files from your reporting application. This option is useful for archiving.
Example
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
report.runFromSerializable(data);
// code snippet ends
In this example:
- An object named
rendereris defined using theImageRendererclass. - The
fileTypeproperty sets the output format. In this example, the files created are .png image files. - The
fromPageproperty sets the first page to be included and thetoPageproperty 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
fileNamePrefixproperty 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.