# Text Print Export

Learn exporting a report with Table and Tablix data regions into the Text Print format.

## Content



The Text Print is a format recommended for printing the RDLX reports with Table and Tablix data regions in the tabular format, preserving the grouping, layout, and formatting. The export is a cross-platform replacement for Text Only printers and is suitable for printing reports in ASCII format, especially on the Dot Matrix printers.

Use the [TxtRenderingExtension](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.TxtRenderingExtension.html) to render your report in Text Print format.

The following steps provide an example of rendering a report in the Text Print format.

1.  Create a new or open an existing Windows Forms App in Visual Studio project.
2.  Go to the Project Explorer, right-click the project and select **Add** > **New Item.**
3.  Select **ActiveReports 19 Standalone Report** > **Add** and choose a report type, **RDLX**, **RDLX Dashboard**, or **Page** report and then click **Finish**.
4.  Add reference to **MESCIUS.ActiveReports.Export.Xml** package in the project.
5.  On the Form.cs or Form.vb that opens, double-click the title bar to create the Form\_Load event.
6.  Add the following code inside the Form\_Load event.
    
    ```vbnet
    ' Provide the Page Report you want to render.
    Dim rptPath As System.IO.FileInfo = New System.IO.FileInfo("..\..\..\Report1.rdlx")
    
    Dim pageReport As GrapeCity.ActiveReports.PageReport = New GrapeCity.ActiveReports.PageReport(rptPath)
    
    ' Create an output directory.
    Dim outputDirectory As New System.IO.DirectoryInfo("C:\MyTextPrint")
    outputDirectory.Create()
    
    ' Provide settings for your rendering output.
    Dim txtSettings = New GrapeCity.ActiveReports.Export.Text.Page.Settings()
    txtSettings.HorizontalPaddings = GrapeCity.ActiveReports.Export.Text.Page.PaddingsType.Keep
    txtSettings.LineEnding = "\r\n"
    txtSettings.CharHeight = 13
    txtSettings.CharWidth = 7
    
    ' Set the rendering extension and render the report.
    
    Dim txtRenderingExtension As GrapeCity.ActiveReports.Export.Text.Page.TxtRenderingExtension = New GrapeCity.ActiveReports.Export.Text.Page.TxtRenderingExtension()
    
    Dim outputProvider As New GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name))
    
    ' Overwrite output file if it already exists.
    outputProvider.OverwriteOutputFile = True
    pageReport.Document.Render(txtRenderingExtension, outputProvider, txtSettings)
    ```
    
    ```csharp
    // Provide the Page Report you want to render.
    System.IO.FileInfo rptPath = new System.IO.FileInfo(@"..\..\..\Report1.rdlx");
    
    GrapeCity.ActiveReports.PageReport pageReport = new GrapeCity.ActiveReports.PageReport(rptPath);
    
    // Create an output directory.
    System.IO.DirectoryInfo outputDirectory = new System.IO.DirectoryInfo(@"C:\MyTextPrint");
    outputDirectory.Create();
    
    // Provide settings for your rendering output.
    var txtSettings = new GrapeCity.ActiveReports.Export.Text.Page.Settings();
    txtSettings.HorizontalPaddings = GrapeCity.ActiveReports.Export.Text.Page.PaddingsType.Keep;
    txtSettings.LineEnding = "\r\n";
    txtSettings.CharHeight = 13;
    txtSettings.CharWidth = 7;
    
    // Set the rendering extension and render the report.
    GrapeCity.ActiveReports.Export.Text.Page.TxtRenderingExtension txtRenderingExtension = new GrapeCity.ActiveReports.Export.Text.Page.TxtRenderingExtension();
    GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider outputProvider = new GrapeCity.ActiveReports.Rendering.IO.FileStreamProvider(outputDirectory, System.IO.Path.GetFileNameWithoutExtension(outputDirectory.Name));
    
    // Overwrite output file if it already exists.
    outputProvider.OverwriteOutputFile = true;
    pageReport.Document.Render(txtRenderingExtension, outputProvider, txtSettings);
    ```
    

### Text Print Rendering Properties

The following options are available while rendering to Text Print format.

| Property | Description |
| --- | --- |
| [CharHeight](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.Settings.html) | Specifies the character height in points. |
| [CharWidth](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.Settings.html) | Specifies the character width in points. |
| [FontFamily](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.Settings.html) |   Specifies the monospace font family. The available options are:  *   Consolas *   Courier New *   Lucida Console   |
| [FontSize](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.Settings.html) |   Specifies the font height in points. Recommended values are Consolas 11, Courier New 10, or Lucida Console 10.   |
| [HorizontalPaddings](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.Settings.html) |   Specifies the horizontal padding:  *   Keep: Retain the original padding *   Adjust: Adjust the padding *   Remove: Remove the padding   |
| [LineEnding](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.Settings.html) | Specifies the end of a line. |

### Limitations

*   Ignores graphics; the output is only plain text.
*   Pagination is not preserved, the output is rendered on a single page
