ActiveReports 18 .NET Edition
Developers / Export Reports / Export Section Reports / RTF Export
In This Topic
    RTF Export
    In This Topic

    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.

    RTF Export usage and limitations

    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.

    Export Report using RTF Export Filter

    Use the following steps to export reports through RTF export filters.

    1. Create a new or open an existing Visual Studio project.
      • If you are creating a new project,
        - select ActiveReports 18 Section Report (xml-based) Application in Create a New Project dialog, and then
        - specify a name for the project, and click OK.
      • If you are using an existing project,
        - go to the Solution Explorer and right-click the project and select Add > New Item, and then
        - select ActiveReports 18 Section Report (xml-based) and click Add.
    2. Add a reference to MESCIUS.ActiveReports.Export.Word package in the project. See Manage ActiveReports Dependencies for more information.
    3. In your project's Bin>Debug folder, place the report.rpx (Section Report).    
    4. On the Form.cs or Form.vb, double-click the title bar to create the Form_Load event.
    5. In Form_Load event, add the following code to export Section Reports .
      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");