ActiveReports 18 .NET Edition
Developers / Export Reports / Export Section Reports / HTML Export
In This Topic
    HTML Export
    In This Topic

    HTML, or hypertext markup language, is a format that opens in a Web browser. The HTML export filter has a number of useful properties that allow you to control your output. You can set the properties either in code using the HTMLExport object after adding reference to MESCIUS.ActiveReports.Export.Html package in your project.

    HTML Export Filter Properties

    Property Valid Values Description
    BookmarkStyle Html (default) or None Set to Html to generate a page of bookmarks from the bookmarks in the report. If the report has no bookmarks, this setting is ignored.
    CharacterSet Big5, EucJp, HzGb2312, Ibm850, Iso2022Jp, Iso2022Kr, Iso8859_1, Iso8859_2, Iso8859_5, Iso8859_6, Koi8r, Ksc5601, ShiftJis, UnicodeUtf16, UnicodeUtf8 (default) Select the IANA character set that you want to use in the meta tag in the header section of the HTML output. This property only takes effect if the IncludeHtmlHeader property is set to True.
    CreateFramesetPage True or False (default) Set to True to generate a set of frames that display a page of bookmarks (if available) in the left frame and the report document in the right frame. The HTML output uses the specified filename with the extension .frame.html.
    IncludeHtmlHeader True (default) or False Set to False if you want to embed the HTML output in another HTML document. Otherwise, the HTML output includes the usual HTML, HEAD, and BODY elements.
    IncludePageMargins True or False (default) Set to True to include the report's margins in the HTML output.
    MultiPage True or False (default) Set to True to create a separate HTML page for each page of the report. Otherwise, the HTML output is a single page.
    OutputType DynamicHtml (default) or LegacyHtml Set to LegacyHtml to use tables for positioning and avoid the use of cascading style sheets (CSS). Otherwise, positioning of controls is handled in the CSS.
    RemoveVerticalSpace True or False (default) Set to True if the OutputType property is set to LegacyHtml and you plan to print the output from a browser. This removes white space from the report to help improve pagination. Otherwise, vertical white space is kept intact.
    Title Any String Enter the text to use in the header section's title. This is displayed in the title bar of the browser.

    Additional Information on Output Types

    By default, the report is exported as DynamicHtml (DHTML), with cascading style sheets (CSS). Using the OutputType property, you can change the output to LegacyHtml (HTML). Neither of the output types creates a report that looks exactly like the one you display in the viewer because of differences in formats. Following is the usage of each output type and controls to avoid in each.

    DynamicHtml (DHTML) usage and limitations

    Usage:

    Does not support:

    LegacyHtml (HTML) usage and limitations

    Usage:

    Does not support:

    HTML Export Filter Limitations

    Export Report using HTML Export Filter

    Use the following steps to export reports through HTML export filter.

    1. Create a new or open an existing Visual Studio project.
      • If you are creating a new project,
        - select ActiveReports 18 Section Report (xml-based) Application in Create a New Project dialog, and then
        - specify a name for the project, and click OK.
      • If you are using an existing project,
        - go to the Solution Explorer and right-click the project and select Add > New Item, and then
        - select ActiveReports 18 Section Report (xml-based) and click Add.
    2. Add a reference to MESCIUS.ActiveReports.Export.Html package in the project. See Manage ActiveReports Dependencies for more information. 
    3. In your project's Bin>Debug folder, place the report.rpx (Section Report).    
    4. On the Form.cs or Form.vb, double-click the title bar to create the Form_Load event.
    5. In Form_Load event, add the following code to export Section Reports .
      Visual Basic.NETcode. Paste INSIDE the Form_Load event
      Copy Code
      ' Create a Section report.
      
      Dim rpt As New GrapeCity.ActiveReports.SectionReport()
      ' For the code to work, report.rpx must be placed in the bin\debug folder of your project.
      Dim xtr As New System.Xml.XmlTextReader(Application.StartupPath + "\report.rpx")
      rpt.LoadLayout(xtr)
      rpt.Run()
                         
      ' Export the report in HTML format.
      Dim HtmlExport1 As New GrapeCity.ActiveReports.Export.Html.Section.HtmlExport()
      HtmlExport1.Export(rpt.Document, Application.StartupPath + "\HTMLExpt.html")
      

      C# code. Paste INSIDE the Form_Load event.
      Copy Code
      // Create a Section Report
      GrapeCity.ActiveReports.SectionReport rpt = new GrapeCity.ActiveReports.SectionReport();
      
      // For the code to work, report.rpx must be placed in the bin\debug folder of your project.
      System.Xml.XmlTextReader xtr = new System.Xml.XmlTextReader(Application.StartupPath + "\\report.rpx");
      rpt.LoadLayout(xtr);
      rpt.Run();
      
      // Export the report in HTML format.
      GrapeCity.ActiveReports.Export.Html.Section.HtmlExport HtmlExport1 = new GrapeCity.ActiveReports.Export.Html.Section.HtmlExport();
      HtmlExport1.Export(rpt.Document, Application.StartupPath + "\\HTMLExpt.html");