ActiveReports 6 Online Help
Export Reports
See Also Send comments on this topic.
ActiveReports 6 > ActiveReports User Guide > How To > Export Reports

Glossary Item Box

 

To export your reports to the various formats that ActiveReports supports, you must first add the export controls to your Visual Studio toolbox. For more information, see the Adding ActiveReports Controls topic. Here are the export formats that are included with ActiveReports:

To export a report

  1. From the Visual Studio toolbox, drag the export filter that you want to use onto your Windows form. The control appears in the component tray below the form.
  2. Double-click in the title bar of the form to create an event-handling method for the form Load event.
  3. Add code to the event to run the report and export it.

The following examples show what the code for the method looks like for each of the export types.

ShowTo write the code in Visual Basic.NET

Visual Basic.NET code. Paste INSIDE the Form Load event. Copy Code
Dim rpt As New NewActiveReport1()
rpt.Run()
Me.HtmlExport1.Export(rpt.Document, Application.StartupPath + "\\HTMLExpt.html")
Me.PdfExport1.Export(rpt.Document, Application.StartupPath + "\\PDFExpt.pdf")
Me.RtfExport1.Export(rpt.Document, Application.StartupPath + "\\RTFExpt.rtf")
Me.TextExport1.Export(rpt.Document, Application.StartupPath + "\\TextExpt.txt")
Me.TiffExport1.Export(rpt.Document, Application.StartupPath + "\\TIFFExpt.tiff")
Me.XlsExport1.Export(rpt.Document, Application.StartupPath + "\\XLSExpt.xls")

ShowTo write the code in C#

C# code. Paste INSIDE the Form Load event. Copy Code
NewActiveReport1 rpt = new NewActiveReport1(); 
rpt.Run();
this.htmlExport1.Export(rpt.Document, Application.StartupPath + "\\HTMLExpt.html"); 
this.pdfExport1.Export(rpt.Document, Application.StartupPath + "\\PDFExpt.pdf");
this.rtfExport1.Export(rpt.Document, Application.StartupPath + "\\RTFExpt.rtf"); 
this.textExport1.Export(rpt.Document, Application.StartupPath + "\\TextExpt.txt");
this.tiffExport1.Export(rpt.Document, Application.StartupPath + "\\TIFFExpt.tiff"); 
this.xlsExport1.Export(rpt.Document, Application.StartupPath + "\\XLSExpt.xls");

See Also