Output as HTML (C#)
Set up and configure output to HTML from your reporting application.
Example
This code snippet uses the
HTMLRenderer
class:// code snippet starts
String designFile = "OrderReport.4rp";
String outputFilename = "SalesList.html";
FormatHandler handler = new FormatWriter(outputFilename);
HTMLRenderer renderer = new HTMLRenderer(handler);
renderer.ignoreColumnAlignment =true;
renderer.embedImages =true;
FourRpLayouter report = new FourRpLayouter(designFile, renderer);
//Run the report
report.debugLevel = 9;
// some code omitted - view full source in demo
report.runFromSerializable(data);
// open the file
System.Diagnostics.Process.Start(outputFilename);
// code snippet ends
In this example:
- A
FormatHandler
object namedhandler
is defined using theFormatWriter
class, taking the name of the output file as its input. - An object named
renderer
is defined using theHTMLRenderer
class, takinghandler
as input. - The
ignoreColumnAlignment
property is set to true, allowing column alignment of items to be ignored for a more compact representation. - The
embedImages
property activates image embedding in the report document. FourRpLayouter report = new FourRpLayouter(designFile, renderer)
creates the FourRpLayouter object for the specified report file that outputs a HTML file with the provided name.
For the full list of properties and methods for this renderer class, refer to the Genero Report Writer .NET API documentation.