Export

Excel workbooks that keep the grid's formats, and CSV.

Excel

api.exportExcel() downloads an .xlsx workbook that keeps what the grid shows:

  • Numbers stay numbers, with their column's format: currency (with its symbol), percent, fixed decimals.
  • Dates and date-times are Excel dates, so they sort and filter as dates.
  • Option columns (select, multi-select, tags, people, linked records) write their labels; other columns their format text.
  • Column widths follow the grid; the header row is bold, frozen and has filter buttons.
  • Grouped and tree grids export as Excel outlines: group rows sit above their rows and collapse.
  • Conditional formats become native Excel ones, so they stay live: edit a number in Excel and its colour, bar or icon follows. Fixed min / max / mid carry over; hex and palette colours are kept (lightened as the grid tints them), anything else falls back to Excel's own colours. Icon sets export as 3 arrows, 3 traffic lights and, for signal, Excel's 4 rating bars.
await api.exportExcel({ fileName: 'orders.xlsx', sheetName: 'Orders' });

// Pick columns and rows
await api.exportExcel({ columns: ['id', 'customer', 'total'], onlySelected: true });

// The workbook as a Blob, to upload or save yourself
const blob = await api.getExcel();
OptionDefaultWhat it does
fileName'export.xlsx'The downloaded file's name
sheetName'Sheet1'The worksheet's name
columnsdisplayed columnsColumn fields to export, in order
onlySelected / rowIdsmatching recordsOnly the selected rows, or these rows in this order
includeHeadertrueThe header row
freezeHeader / autoFiltertrueKeep the header in view; give it filter buttons
includeGroups / includeTotalstrueGroup and total rows of grouped grids
localethe browser'sLocale for currency symbols

Without onlySelected or rowIds, every record that passes the filters is exported, on every page. The workbook is written by the grid itself (no extra dependency) and compressed with the browser's CompressionStream. The grid's context menu has Export as Excel.

CSV

api.exportCsv({ fileName: 'orders.csv' });
const text = api.getCsv({ delimiter: ';' });

CSV writes each cell as text (through format); grouped grids export the hierarchy with group and total rows (includeGroups, includeTotals) and the hierarchy column indented or as a path (hierarchyText).

Edit on GitHub

Last updated on

On this page