RTF, or RichText format, opens in Microsoft Word, and is native to WordPad. This export does not render reports exactly as they appear in the Viewer due to inherent differences in the formats. You can set the property either in code using the RTFExport object after adding reference to MESCIUS.ActiveReports.Export.Word package in your project.
The RTF export now supports the CrossPlatform compatibility mode.
Usage:
Does not support:
RTF Export Properties
Property | Valid Values | Description |
---|---|---|
EnableShapes | True or False (default) | Indicates whether to export the Shapes and Lines to the RTF format if set to True. Microsoft Word is required to view it correctly. |
Pagination | True (default)or False | Indicates whether to use pagination for the output RTF document. |
Use the following steps to export reports through RTF export filters.
Visual Basic.NETcode. Paste INSIDE the Form_Load event |
Copy Code
|
---|---|
' Create a Section report. Dim rpt As New GrapeCity.ActiveReports.SectionReport() ' For the code to work, report.rpx must be placed in the bin\debug folder of your project. Dim xtr As New System.Xml.XmlTextReader(Application.StartupPath + "\report.rpx") rpt.LoadLayout(xtr) rpt.Run() ' Export the report in RTF format. Dim RtfExport1 As New GrapeCity.ActiveReports.Export.Word.Section.RtfExport() RtfExport1.Export(rpt.Document, Application.StartupPath + "\RTFExpt.rtf") |
C# code. Paste INSIDE the Form_Load event. |
Copy Code
|
---|---|
// Create a Section Report GrapeCity.ActiveReports.SectionReport rpt = new GrapeCity.ActiveReports.SectionReport(); // For the code to work, report.rpx must be placed in the bin\debug folder of your project. System.Xml.XmlTextReader xtr = new System.Xml.XmlTextReader(Application.StartupPath + "\\report.rpx"); rpt.LoadLayout(xtr); rpt.Run(); // Export the report in RTF format. GrapeCity.ActiveReports.Export.Word.Section.RtfExport RtfExport1 = new GrapeCity.ActiveReports.Export.Word.Section.RtfExport(); RtfExport1.Export(rpt.Document, Application.StartupPath + "\\RTFExpt.rtf"); |