# Report Format Type - CSV

Canonical page: https://www.adaptabletools.com/docs/handbook-exporting-reports-format-type-csv

- AdapTable offers a CSV Report Format which allows grid data to be exported in CSV format

Reports can be given a Report Format of CSV.

CSV formatted Reports can be exported to all destinations.

## CSV Separator

By default AdapTable will use a comma (',') to separate the values, but this can be changed by developers using the `csvSeparator` property in [Export Options](https://www.adaptabletools.com/docs/technical-reference-exporting/index.md).

### `csvSeparator`

Separator to use in CSV format

This property allows developers to change the default CSV separator value of a comma.

The property can return either a string, or function which takes a [`BaseExportContext`](https://www.adaptabletools.com/docs/reference/baseexportcontext.md) object and returns a string.

```ts
csvSeparator?: string | ((csvSeparatorContext: BaseExportContext) => string);
```

The `BaseExportContext` contains these properties:

| Property | Type | Description |
| --- | --- | --- |
| [exportDestination](https://www.adaptabletools.com/docs/reference/baseexportcontext.md#exportdestination) | [`ExportDestinationType`](https://www.adaptabletools.com/docs/reference/exportdestinationtype.md) | Export Destination for the Report |
| [report](https://www.adaptabletools.com/docs/reference/baseexportcontext.md#report) | [`Report`](https://www.adaptabletools.com/docs/reference/report.md) | The Report Configuration being run |
| [reportFormat](https://www.adaptabletools.com/docs/reference/baseexportcontext.md#reportformat) | [`ReportFormatType`](https://www.adaptabletools.com/docs/reference/reportformattype.md) | Format of the Report being run |
| [reportName](https://www.adaptabletools.com/docs/reference/baseexportcontext.md#reportname) | [`ReportNameType`](https://www.adaptabletools.com/docs/reference/reportnametype.md) | Name of the Report being run |
| [adaptableContext](https://www.adaptabletools.com/docs/reference/baseexportcontext.md#adaptablecontext) | `any` | Custom application Context provided in `AdaptableOptions.adaptableContext` |

```ts {4}
// Use a pipe to separate values in the CSV file
const adaptableOptions: AdaptableOptions = {
  exportOptions: {
   csvSeparator: '|'
  }
} 
```

**Example: CSV Report Format**

Exporting Data from AdapTable in CSV Format

 

- This demo sets the Current Report Format in Initial State to CSV, and changed the CSV separator to be a '|'
- Exporting a report will send the data in CSV format with the custom delimiter
 

Demo project (Vanilla); the files without a marker are shown below:

```text
src/
  adaptableOptions.ts
  agGridModules.ts     [template]
  columnDefs.ts        [template]
  gridOptions.ts       [template]
  index.ts             [template]
  onAdaptableReady.ts  [template]
  rowData.ts           [template]
  styles.css           [template]
index.html             [template]
package.json           [template]
tsconfig.json          [template]
```

Files marked `[template]` are the same in every demo; see the [demo template](https://www.adaptabletools.com/llms/demo-template.md#vanilla).

**`src/adaptableOptions.ts`**

```ts
import {AdaptableOptions} from '@adaptabletools/adaptable';
import {WebFramework} from './rowData';

export const adaptableOptions: AdaptableOptions<WebFramework> = {
  primaryKey: 'id',
  adaptableId: 'CSV Report Format',
  exportOptions: {
    csvSeparator: '|',
  },
  initialState: {
    Dashboard: {
      Tabs: [
        {
          Name: 'Demo',
          Toolbars: ['Export'],
        },
      ],
      ModuleButtons: ['Export'],
    },
    StatusBar: {
      StatusBars: [
        {
          Key: 'Center Panel',
          StatusBarPanels: ['Export'],
        },
      ],
    },
    Theme: {CurrentTheme: 'dark'},
    Export: {
      CurrentFormat: 'CSV',
    },
    Layout: {
      CurrentLayout: 'Standard Layout',
      Layouts: [
        {
          TableColumns: [
            'name',
            'language',
            'github_stars',
            'license',
            'has_projects',
            'has_pages',
            'created_at',
            'has_wiki',
            'updated_at',
            'pushed_at',
            'github_watchers',
            'week_issue_change',
          ],
          Name: 'Standard Layout',
          AutoSizeColumns: true,
        },
      ],
    },
  },
};
```
