# Report Format Types

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

- AdapTable ships with 4 Report Format Types that can be used to format Report data:
  - Excel
  - VisualExcel
  - JSON
  - CSV

Reports in AdapTable can be exported using 4 different Report Format Types:

- `Excel`
- `VisualExcel`
- `JSON`
- `CSV` 

2 Format Types (JSON, CSV) export to File and Clipboard, and 2 (Excel, VisualExcel) just to File:

| Report Format | All Reports | Exports to File | Exports to Clipboard |
| ------------- | :---------: | :-------------: | :------------------: |
| [Excel](https://www.adaptabletools.com/docs/handbook-exporting-reports-format-type-excel/index.md)       |      ✅      |        ✅        |          ❌           |
| [Visual Excel](https://www.adaptabletools.com/docs/handbook-exporting-reports-format-type-visual-excel/index.md) |      ✅      |        ✅        |          ❌           |
| `JSON`        |      ✅      |        ✅        |          ✅           |
| `CSV`         |      ✅      |        ✅        |          ✅           |

## Limiting System Report Formats

By default all System Report Format Types will be shipped with AdapTable and available for use.

However this can be changed via the `systemReportFormats` property of [Export Options](https://www.adaptabletools.com/docs/technical-reference-exporting/index.md).

The property returns a list (either directly or via a function) of which System Report Formats should be available.

### `systemReportFormats`

Sets which System Report Formats are available for users

  [`SystemReportFormat[]`](https://www.adaptabletools.com/docs/reference/systemreportformat.md)

Use this property to specify a custom list of the System Report Formats which should be available to users.

You can return either an array of report formats, or provide a function which returns an array.

<b>Hard Coded List</b>

The simplest method is to return an array listing which System Report Formats should be available:

```ts {4}
// Show just 'CSV' and 'JSON' System Report Formats
const adaptableOptions: AdaptableOptions = {
    exportOptions: {
        systemReportFormats: ['CSV', 'JSON'],
    }
} 
```

Provide an **empty** array if you want **no** System Report Formats to be available:
```ts {4}
// Show No System Report Formats
const adaptableOptions: AdaptableOptions = {
  exportOptions: {
      systemReportFormats: [],
  }
} 
```

<b>Via a Function</b>

Alternatively, you can provide a function which returns the System Report Formats.

The function receives context of type [`SystemReportFormatsContext`](https://www.adaptabletools.com/docs/reference/systemreportformatscontext.md) defined as follows:

| Property | Type | Description |
| --- | --- | --- |
| [currentLayoutName](https://www.adaptabletools.com/docs/reference/systemreportformatscontext.md#currentlayoutname) | `string` | Name of current Layout |
| [currentReportName](https://www.adaptabletools.com/docs/reference/systemreportformatscontext.md#currentreportname) | [`ReportNameType`](https://www.adaptabletools.com/docs/reference/reportnametype.md) | Name of current Report |
| [defaultSystemReportFormats](https://www.adaptabletools.com/docs/reference/systemreportformatscontext.md#defaultsystemreportformats) | [`SystemReportFormat`](https://www.adaptabletools.com/docs/reference/systemreportformat.md)`[]` | Default System Report Formats |
| [adaptableContext](https://www.adaptabletools.com/docs/reference/systemreportformatscontext.md#adaptablecontext) | `any` | Custom application Context provided in `AdaptableOptions.adaptableContext` |

```ts {4}
// Show just JSON and CSV Report Formats for 'All Data' System Report
const adaptableOptions: AdaptableOptions = {
    exportOptions: {
      systemReportFormats: (context: SystemReportFormatsContext) => {
        return context.currentReportName == 'All Data'
          ? ['JSON', 'CSV']
          : context.defaultSystemReportFormats;
      },
    }
} 
```

**Example: Configuring System Report Formats**

Configuring which System Report Formats are available

 

- In this example AdapTable has been limited to just 2 System Report Formats:
  - `JSON`
  - `CSV`

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: 'Configuring System Report Formats',
  exportOptions: {
    systemReportFormats: ['CSV', 'JSON'],
  },
  initialState: {
    Dashboard: {
      Tabs: [
        {
          Name: 'Demo',
          Toolbars: ['Export'],
        },
      ],
    },
    StatusBar: {
      StatusBars: [
        {
          Key: 'Center Panel',
          StatusBarPanels: ['Export'],
        },
      ],
    },
    Theme: {CurrentTheme: 'dark'},
    Export: {
      CurrentReport: 'All Data',
      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,
        },
      ],
    },
  },
};
```

### FAQ

**Can I export using a different Report Format Type to those provided by AdapTable e.g. PDF?**
At the moment its not possible to provide custom Report Format Types in the same way as Custom Reports but we hope to introduce that functionality soon.
However you can provide PDF as a [Custom Export Destination](https://www.adaptabletools.com/docs/handbook-exporting-destinations-custom/index.md) and then AdapTable will invoke the export function you provide, allowing you to use whichever PDF converter library you wish.
