Glossary Item Box

ActiveReports for .NET 2 Online Help Send feedback to Data Dynamics

HTML, Tables and Exporting with RichText

ActiveReports supports exporting with tables in the RichText control. RichText controls can be loaded with an RTF file which contains tables, or even an HTML file, and the resulting report can be exported to any of a number of formats.

This walkthrough illustrates how to create and export a report which contains the RichText control.

This walkthrough is split up into the following activities:

To complete the walkthrough, you will need an RTF file which contains a table.

Adding an ActiveReport to the Visual Studio project

To add an ActiveReport to your project

  1. Open a new project in Visual Studio.
  2. Click on Project > Add New Item.
  3. Select ActiveReports file and rename the file rptRich.
  4. Click Open.

Adding the export filters to your project

To add the export filters to your project

  1. Click on the following export controls one at a time in the appropriate toolbox to select them.
    • HtmlExport
    • PdfExport
    • RtfExport
    • TextExport
    • TiffExport
    • XlsExport
  2. Drag each control onto the Windows Form.
  3. The controls will appear in the tray below the Windows Form.

Adding controls to the report to contain data

To add controls to the report

  1. Add the following controls to the Detail section:

    Control DataField Name Text/Caption Misc Details Location
    RichText (Empty string) rtfRTF (Empty string) (Empty string) 0, 0
    RichText (Empty string) rtfHTML (Empty string) (Empty string) 0, 0

Loading an RTF file into a RichText control

To load an RTF file into the RichText control

To write the code in Visual Basic

To write the code in C#

Creating an HTML file to be loaded into a RichText control

To write a quick HTML file

Loading the HTML file into a RichText control

To write the code in Visual Basic

To write the code in C#

Viewing the report

To view the report

  1. Add the ActiveReports viewer control to Form1.
  2. Set the viewer control's Dock property to Fill.
  3. Add the code needed to set the viewer document equal to the report document.

To write the code for the viewer in Visual Basic

To write the code for the viewer in C#

Using the export methods to export data to all available file formats

To write the code in Visual Basic

To write the code in C#

 

 


Copyright © 2004-2005 Data Dynamics, Ltd. All rights reserved.