ActiveReports 6 Online Help
Custom HTML Outputter
Show AllShow All
Hide AllHide All

You can create a custom HTML outputter for your ActiveReports ASP.NET Web Application.

This walkthrough is split up into the following activities:

To add the Html Export control to the Web Form

  1. From the Visual Studio View menu, select Component Designer to go to the design view of the ASPX file.
  2. Drag the HtmlExport control from the Visual Studio toolbox onto the ASPX design view. See Adding ActiveReports controls for help if you need to add it to the toolbox.
    Note: You can instead add a reference to ActiveReports.HtmlExport in the Solution Explorer if you prefer.

To create a public class for the HTML outputter

  1. In the Solution Explorer window, right-click on your project name and select Add, then New Item.
  2. In the Add New Item dialog that appears, select Class.
  3. Change the name of the class to MyCustomHtmlOutputter and click the Add button.
  4. This opens the code view of the class file where you can add the code needed to create the public class.
  5. For C# code, add the IOutputHtml interface to MyCustomHtmlOutputter class.
    C# code.
    Copy Code
    public class MyCustomHtmlOutputter: IOutputHtml                          
    

The following example shows what the complete code for the method looks like.

To write the code in Visual Basic.NET

To write the code in C#

To add code to the Web Form to export to HTML

  1. Add an ActiveReport to the project, and name it rptCustHTML.
  2. Double-click on the design view of the ASPX. This creates an event-handling method for the Web Form's Page Load event.
  3. Add the following code to the Page Load event.

The following example shows what the code for the method looks like.

To write the code in Visual Basic.NET

To write the code in C#

To add a folder to the project for report output

  1. In the Solution Explorer, right-click your solution and select Add, then New Folder.
  2. Name the folder ReportOutput.
  3. Ensure that you have write permissions for this folder.
  4. To view the results in your Web browser, run the project.
See Also