ActiveReports 6 Online Help
Custom Web Exporting (Std Edition)
Show AllShow All
Hide AllHide All

ActiveReports provides components that allow you to export your reports into several popular formats. The following walkthroughs demonstrate how to set up report custom exporting to PDF, Excel, TIFF, RTF, and plain text formats. You can similarly export to HTML, or you can create a custom HTML outputter.

To add a report and an export control to the Web project

  1. From the View menu, select Component Designer to go to the design view of the aspx file.
  2. Select the export control you want to use in the Visual Studio toolbox. (See Adding ActiveReports controls for help on adding them to the toolbox.)
  3. Drag the export control onto the aspx design view.
    Note: You can instead add a reference to ActiveReports.HtmlExport in the Solution Explorer if you prefer.
  4. From the Project menu, select Add New Item.
  5. In the Add New Item window that appears, select the ActiveReports 6 (code-based) File template, set the report's name to NewActiveReport1, and click the Add button.
  6. Design your report.

To add code to the Web Form to export a report

  1. Double-click on the design view of the aspx page. This creates an event-handling method for the Page_Load event.
  2. Add code like the following to the Page_Load event.

PDF

To write the code in Visual Basic.NET

To write the code in C#

Note: To use the one-touch printing option, add the following to the code above.

Visual Basic.NET code. Paste INSIDE the Page Load event.
Copy Code
pdfExport1.Options.OnlyForPrint = True
C# code. Paste INSIDE the Page Load event.
Copy Code
pdfExport1.Options.OnlyForPrint = true;

Excel

To write the code in Visual Basic.NET

To write the code in C#

TIFF

To write the code in Visual Basic.NET

To write the code in C#

RTF

To write the code in Visual Basic.NET

To write the code in C#

Plain Text

To write the code in Visual Basic.NET

To write the code in C#

To view the results in your Web browser, run the project.

See Also

How To