ActiveReports 9 > ActiveReports User Guide > Concepts > Exporting > Export Filters > Exporting Reports using Export Filters |
ActiveReports provides various export filters that can be used to export Page, Section and Rdl Reports to the supported file formats. Here are the export formats that are included with ActiveReports:
Note: HTML Export requires the .NET Framework full profile version. To ensure you are using the full profile version, go to the Visual Studio Project menu > Properties > Compile tab > Advanced Compile Options (for Visual Basic projects) or to the Project menu > Properties > Application tab (for C# projects) and under Target framework select a full profile version. |
Note: In ActiveReports, by default, the assemblies are located in the ...\Common Files\ComponentOne\ActiveReports 9 folder. |
Use the following steps to export reports through export filters. These steps assume that you have already created a Windows Application and added the export controls to your Visual Studio toolbox. For more information, see Adding ActiveReports Controls.
GrapeCity.ActiveReports.Export.Excel.v9
GrapeCity.ActiveReports.Export.Html.v9
GrapeCity.ActiveReports.Export.Image.v9
GrapeCity.ActiveReports.Export.Pdf.v9
GrapeCity.ActiveReports.Export.Word.v9
GrapeCity.ActiveReports.Export.Xml.v9
To add Page/Rdl report to your project
Visual Basic.NET code. Paste INSIDE the Form_Load event. |
Copy Code
|
---|---|
' Create a page/Rdl report. Dim rpt As New GrapeCity.ActiveReports.PageReport() ' Load the report you want to export. ' For the code to work, this report must be stored in the bin\debug folder of your project. rpt.Load(New System.IO.FileInfo ("report.rdlx")) Dim MyDocument As New GrapeCity.ActiveReports.Document.PageDocument (rpt) |
C# code. Paste INSIDE the Form_Load event. |
Copy Code
|
---|---|
// Create a page/Rdl report. GrapeCity.ActiveReports.PageReport rpt = new GrapeCity.ActiveReports.PageReport(); // Load the report you want to export. // For the code to work, this report must be stored in the bin\debug folder of your project. rpt.Load(new System.IO.FileInfo ("report.rdlx")); GrapeCity.ActiveReports.Document.PageDocument MyDocument = new GrapeCity.ActiveReports.Document.PageDocument (rpt); |
To add Section report to your project
Visual Basic.NETcode. Paste INSIDE the Form_Load event. |
Copy Code
|
---|---|
' Create a Section report. |
C# code. Paste INSIDE the Form_Load event. |
Copy Code
|
---|---|
// Create a Section report. |
To write the code in Visual Basic.NET
Visual Basic.NET code. Paste INSIDE the Form_Load event. |
Copy Code
|
---|---|
' Export the report in HTML format. Dim HtmlExport1 As New GrapeCity.ActiveReports.Export.Html.Section.HtmlExport() HtmlExport1.Export(MyDocument, Application.StartupPath + "\HTMLExpt.html") ' Export the report in PDF format. Dim PdfExport1 As New GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport() PdfExport1.Export(MyDocument, Application.StartupPath + "\PDFExpt.pdf") ' Export the report in RTF format. Dim RtfExport1 As New GrapeCity.ActiveReports.Export.Word.Section.RtfExport() RtfExport1.Export(MyDocument, Application.StartupPath + "\RTFExpt.rtf") ' Export the report in text format. Dim TextExport1 As New GrapeCity.ActiveReports.Export.Xml.Section.TextExport() TextExport1.Export(MyDocument, Application.StartupPath + "\TextExpt.txt") ' Export the report in TIFF format. Dim TiffExport1 As New GrapeCity.ActiveReports.Export.Image.Tiff.Section.TiffExport() TiffExport1.Export(MyDocument, Application.StartupPath + "\TIFFExpt.tiff") ' Export the report in Excel format. Dim XlsExport1 As New GrapeCity.ActiveReports.Export.Excel.Section.XlsExport() ' Set a file format of the exported excel file to Xlsx to support Microsoft Excel 2007 and newer versions. XlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx XlsExport1.Export(MyDocument, Application.StartupPath + "\XLSExpt.xlsx") |
To write the code in C#
C# code. Paste INSIDE the Form_Load event. |
Copy Code
|
---|---|
// Export the report in HTML format. GrapeCity.ActiveReports.Export.Html.Section.HtmlExport HtmlExport1 = new GrapeCity.ActiveReports.Export.Html.Section.HtmlExport(); HtmlExport1.Export(MyDocument, Application.StartupPath + "\\HTMLExpt.html"); // Export the report in PDF format. GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport PdfExport1 = new GrapeCity.ActiveReports.Export.Pdf.Section.PdfExport(); PdfExport1.Export(MyDocument, Application.StartupPath + "\\PDFExpt.pdf"); // Export the report in RTF format. GrapeCity.ActiveReports.Export.Word.Section.RtfExport RtfExport1 = new GrapeCity.ActiveReports.Export.Word.Section.RtfExport(); RtfExport1.Export(MyDocument, Application.StartupPath + "\\RTFExpt.rtf"); // Export the report in text format. GrapeCity.ActiveReports.Export.Xml.Section.TextExport TextExport1 = new GrapeCity.ActiveReports.Export.Xml.Section.TextExport(); TextExport1.Export(MyDocument, Application.StartupPath + "\\TextExpt.txt"); // Export the report in TIFF format. GrapeCity.ActiveReports.Export.Image.Tiff.Section.TiffExport TiffExport1 = new GrapeCity.ActiveReports.Export.Image.Tiff.Section.TiffExport(); TiffExport1.Export(MyDocument, Application.StartupPath + "\\TIFFExpt.tiff"); // Export the report in XLSX format. GrapeCity.ActiveReports.Export.Excel.Section.XlsExport XlsExport1 = new GrapeCity.ActiveReports.Export.Excel.Section.XlsExport(); // Set a file format of the exported excel file to Xlsx to support Microsoft Excel 2007 and newer versions. XlsExport1.FileFormat = GrapeCity.ActiveReports.Export.Excel.Section.FileFormat.Xlsx; XlsExport1.Export(MyDocument, Application.StartupPath + "\\XLSExpt.xlsx"); |