# CSV Export

This topic illustrates the steps to render a report in the CSV format with ActiveReports.

## Content

Comma-Separated Values (CSV) is a form of structured data in plain text. The text in a CSV file is saved as series of values separated by commas. You can use the [CsvRenderingExtension](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.html) to render your report in this format.

## CSV Rendering Properties

ActiveReports offers several options to control how reports render to CSV.

| Property | Description |
| -------- | ----------- |
| [ColumnsDelimiter](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings.ColumnsDelimiter.html) | Sets or returns the text inserted between columns. |
| [DateTimeFormat](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings.DateTimeFormat.html) | Specifies the default format for date values, for example, 'yyyy-MM-dd'. |
| [Encoding](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings.Encoding.html) | Specifies the encoding schema for output. |
| [NoHeader](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings.NoHeader.html) | Specifies whether to omit the CSV Header. |
| [NumericFormat](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings.NumericFormat.html) | Specifies the format for numeric values, for example, '0.####'. |
| [QuotationSymbol](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings.QuotationSymbol.html) | Sets or returns the qualifier character to put around results. |
| [RowsDelimiter](/activereportsnet/api/v19.2/MESCIUS.ActiveReports.Export.Xml/GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings.RowsDelimiter.html) | Sets or returns the text inserted between rows. |

## Export Report using CSV Rendering Extension

The following steps provide an example of rendering a report in the Csv 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 a 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:\MyCSV")
outputDirectory.Create()

' Provide settings for your rendering output.
Dim csvSettings As New GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings()

csvSettings.ColumnsDelimiter = ","
csvSettings.Encoding = System.Text.Encoding.UTF8
csvSettings.NoHeader = True
csvSettings.QuotationMode = GrapeCity.ActiveReports.Export.Text.Page.QuotationMode.AlwaysQuote
csvSettings.QuotationSymbol = """"c
csvSettings.RowsDelimiter = vbCr & vbLf

' Set the rendering extension and render the report.
Dim csvRenderingExtension As New GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension()
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(csvRenderingExtension, outputProvider, csvSettings)
```

```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:\MyCSV");
outputDirectory.Create();

// Provide settings for your rendering output.
GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings csvSettings = new GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension.Settings();
csvSettings.ColumnsDelimiter = ",";
csvSettings.Encoding = Encoding.UTF8;
csvSettings.NoHeader = true;
csvSettings.QuotationMode = GrapeCity.ActiveReports.Export.Text.Page.QuotationMode.AlwaysQuote;
csvSettings.QuotationSymbol = '"';
csvSettings.RowsDelimiter = "\r\n";
                         
// Set the rendering extension and render the report.
GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension csvRenderingExtension = new GrapeCity.ActiveReports.Export.Text.Page.CsvRenderingExtension();
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(csvRenderingExtension, outputProvider, csvSettings);
```