HTML, or hypertext markup language, is a format that opens in a Web browser. You can export your reports to HTML. It is a good format for delivering content because virtually all users have an HTML browser. The HTMLRenderingExtension renders your report in this format with improved table border rendering and high-quality SVG output for charts. If you do not want to use SVG in charts, set the RenderingEngine property to Html.
ActiveReports offers several options to control how reports render to HTML.
Property | Description |
---|---|
EmbedImages | Set to true to embed image in the html file. |
Fragment | Determine whether or not the full HTML text will be returned or just the contents contained inside the body tag will be returned. True indicates only the content inside the body tag will be returned. The default is false. |
OutputTOC | Indicates whether the report's existing TOC should be added to the output. |
RenderingEngine | The RenderingEngine property is set to Mixed by default for improved quality output. The choices are Html or Mixed, where Mixed uses SVG to render charts. |
StyleStream | Set the StyleStream to True to create an external .css file containing style information from your report controls' style properties. If you prefer to have style information embedded in the HTML file, set the StyleStream property to False. |
LinkTarget | Specify a link target to control whether drill-down reports and other links open in a new window or reuse the current window. By default, no value is set and links open in the same window. A value of _blank opens the link in a new window, or you can specify a window using window_name. By default, this value is not set. |
Mode | Galley mode renders the report in one HTML stream. Select Paginated mode to render each page as a section inside the HTML document. |
Reports rendered in HTML support a number of interactive features. Hyperlinks, Bookmarks, and Drill through links can be rendered to HTML. However, Document Maps are not available in this format. For a drill-down report, make sure that the data you want to display is expanded before rendering, otherwise, it renders in the hidden state.
The following steps provide an example of rendering a report in HTML 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:\MyHTML") outputDirectory.Create() ' Provide settings for your rendering output. Dim htmlSetting As New GrapeCity.ActiveReports.Export.Html.Page.Settings() Dim setting As GrapeCity.ActiveReports.Extensibility.Rendering.ISettings = htmlSetting ' Set the rendering extension and render the report. Dim htmlRenderingExtension As New GrapeCity.ActiveReports.Export.Html.Page.HtmlRenderingExtension() 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(htmlRenderingExtension, outputProvider, htmlSetting) |
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:\MyHTML"); outputDirectory.Create(); // Provide settings for your rendering output. GrapeCity.ActiveReports.Export.Html.Page.Settings htmlSetting = new GrapeCity.ActiveReports.Export.Html.Page.Settings(); GrapeCity.ActiveReports.Extensibility.Rendering.ISettings setting = htmlSetting; // Set the rendering extension and render the report. GrapeCity.ActiveReports.Export.Html.Page.HtmlRenderingExtension htmlRenderingExtension = new GrapeCity.ActiveReports.Export.Html.Page.HtmlRenderingExtension(); 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(htmlRenderingExtension, outputProvider, htmlSetting); |