# CsvSaveOptions Interface

> CsvSaveOptions interface in the TX Sheet Control TypeScript API for the browser: CSV export includes every selected row.

- **Product:** TX Sheet Control
- **Section:** Documentation
- **Kind:** Interface
- **Path:** TX Sheet Control > API Reference > TypeScript API > Browser Editor > CsvSaveOptions Interface
- **963 words**
- **Web URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/
- **LLMs URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/llms.txt
- **LLMs-Full URL:** https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/llms-full.txt

---

CSV export includes every selected row. hasHeaderRow does not remove or generate a CSV row.

Package: `@txtextcontrol/tx-sheet-control`. Version: **2.0.0**.

Type-only declaration; it is not a JavaScript runtime constructor.

### Members

#### Properties

| Property | Description |
|---|---|
| [bom](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/bom-property/llms-full.txt) | Include a UTF-8 byte-order mark for applications that require it. Default false. |
| [decimalSeparator](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/decimalseparator-property/llms-full.txt) | Decimal separator for numeric values; defaults to period. |
| [delimiter](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/delimiter-property/llms-full.txt) | One non-quote, non-newline delimiter; defaults to comma. |
| [escapeFormulas](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/escapeformulas-property/llms-full.txt) | Prefix formula-like text with an apostrophe for spreadsheet consumers. Default true; false preserves exact text. |
| [hasHeaderRow](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/hasheaderrow-property/llms-full.txt) | For JSON records and XML, use the first selected row as field names. Default true; false generates Column1, etc. |
| [lineEnding](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/lineending-property/llms-full.txt) | Record ending; defaults to CRLF. Embedded line breaks remain inside quoted fields. |
| [maxCells](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/maxcells-property/llms-full.txt) | Maximum selected rectangular cell count, including blanks. Defaults to 1,000,000. |
| [maxFileBytes](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/maxfilebytes-property/llms-full.txt) | Maximum encoded output bytes; defaults to 32 MiB. |
| [range](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/range-property/llms-full.txt) | Inclusive A1 rectangle. Defaults to A1 through the last populated cell; formatting alone does not extend it. |
| [sheetName](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/sheetname-property/llms-full.txt) | Worksheet name; defaults to the active worksheet. |

### Examples

Use a fresh workbook. Create and format the sample data, apply this API and retain the returned document or result in your application. In the browser pass editor.workbook; in Node.js pass the server control.

```typescript
import type { Workbook } from '@txtextcontrol/tx-sheet-control';
import { StreamType, type CsvSaveOptions } from '@txtextcontrol/tx-sheet-control';

async function createCsvSaveOptionsReport(book: Workbook) {
    const sheet = book.sheets.at(0);
    sheet.range('A1:C2').setValues([
        ['Customer', 'Amount', 'Total'],
        ['Müller', 125.5, null],
    ]);

    sheet.cell('C2').setFormula('=B2*1.19');

    const options: CsvSaveOptions = {
        sheetName: 'Sheet1',
        range: 'A1:C2',
        hasHeaderRow: true,
        maxCells: 10000,
        maxFileBytes: 1048576,
        delimiter: ';',
        decimalSeparator: ',',
        bom: true,
        lineEnding: '\r\n',
        escapeFormulas: true,
    };

    return await book.save(StreamType.CSV, options);
}
```

### See Also

- [TypeScript Browser Editor API](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/llms-full.txt)
- [CSV, XML and JSON Data](https://docs.textcontrol.com/tx-sheet-control/document-processing/tabular-data/llms-full.txt)

---

## In This Section

- [CsvSaveOptions.bom Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/bom-property/llms-full.txt): CsvSaveOptions.bom property in the TX Sheet Control TypeScript API for the browser: Include a UTF-8 byte-order mark for applications that require it.
- [CsvSaveOptions.decimalSeparator Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/decimalseparator-property/llms-full.txt): CsvSaveOptions.decimalSeparator property in the TX Sheet Control TypeScript API for the browser: Decimal separator for numeric values.
- [CsvSaveOptions.delimiter Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/delimiter-property/llms-full.txt): CsvSaveOptions.delimiter property in the TX Sheet Control TypeScript API for the browser: One non-quote, non-newline delimiter; defaults to comma.
- [CsvSaveOptions.escapeFormulas Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/escapeformulas-property/llms-full.txt): CsvSaveOptions.escapeFormulas property in the browser TypeScript API: Prefix formula-like text with an apostrophe for spreadsheet consumers.
- [CsvSaveOptions.hasHeaderRow Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/hasheaderrow-property/llms-full.txt): CsvSaveOptions.hasHeaderRow property in the browser TypeScript API: For JSON records and XML, use the first selected row as field names.
- [CsvSaveOptions.lineEnding Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/lineending-property/llms-full.txt): CsvSaveOptions.lineEnding property in the TX Sheet Control TypeScript API for the browser: Record ending; defaults to CRLF.
- [CsvSaveOptions.maxCells Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/maxcells-property/llms-full.txt): CsvSaveOptions.maxCells property in the TX Sheet Control TypeScript API for the browser: Maximum selected rectangular cell count, including blanks.
- [CsvSaveOptions.maxFileBytes Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/maxfilebytes-property/llms-full.txt): CsvSaveOptions.maxFileBytes property in the TX Sheet Control TypeScript API for the browser: Maximum encoded output bytes; defaults to 32 MiB.
- [CsvSaveOptions.range Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/range-property/llms-full.txt): CsvSaveOptions.range property in the TX Sheet Control TypeScript API for the browser: Inclusive A1 rectangle. Defaults to A1 through the last populated cell.
- [CsvSaveOptions.sheetName Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/sheetname-property/llms-full.txt): CsvSaveOptions.sheetName property in the TX Sheet Control TypeScript API for the browser: Worksheet name; defaults to the active worksheet.

---

## Nearby

- **Previous:** [CsvLoadOptions.sheetName Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvloadoptions/sheetname-property/llms-full.txt)
- **Next:** [CsvSaveOptions.bom Property](https://docs.textcontrol.com/tx-sheet-control/reference/typescript-api/browser/csvsaveoptions/bom-property/llms-full.txt)
