ReoGrid ReoGrid Web

Save Grid as XLSX

Trigger a browser download of the current worksheet as an .xlsx file.

Pro only. saveAsXlsx is a no-op in the Lite edition and emits a console.warn.

Basic usage

import { createReogrid } from '@reogrid/pro';

const { worksheet } = createReogrid('#grid');

// ...populate the grid...

worksheet.saveAsXlsx({
  filename: 'report.xlsx',
  sheetName: 'Q1 2026',
});

Defaults: filename: 'reogrid.xlsx', sheetName: 'Sheet1'.

Trigger from a button (React)

import { Reogrid, type ReogridInstance } from '@reogrid/pro/react';
import { useRef } from 'react';

export default function App() {
  const ref = useRef<ReogridInstance>(null);

  return (
    <>
      <button onClick={() => ref.current?.worksheet.saveAsXlsx({ filename: 'export.xlsx' })}>
        Download XLSX
      </button>
      <Reogrid ref={ref} style={{ width: '100%', height: 500 }} />
    </>
  );
}

What gets exported

IncludedNotes
Cell valuesStrings, numbers, booleans
FormulasWith cached computed results (Excel re-evaluates on open)
StylesFont, color, alignment, background
Number formatsBuilt-in Excel codes + custom
Merged cellsPreserved as xlsx merges
BordersAll four sides per cell
Row heights / column widthsExact pixel → point conversion
Conditional formattingcellIs, expression, containsText rules
ImagesEmbedded media (xlsx drawing parts)

Round-trip: loadXlsxsaveAsXlsx preserves all of the above.

Export without downloading

To build the xlsx bytes without triggering a download — for example to attach to a form post or send to a server:

import { buildXlsxFromSnapshot } from '@reogrid/pro';

const snapshot = worksheet.getExportSnapshot();
const bytes: Uint8Array = buildXlsxFromSnapshot(snapshot, 'Sheet1');

await fetch('/api/upload', {
  method: 'POST',
  headers: { 'Content-Type': 'application/vnd.openxmlformats-officedocument.spreadsheetml.sheet' },
  body: bytes,
});

See also

Stay Updated

Be first to know — get updates as they ship

Get notified of new releases, features, and announcements.
No spam — just updates that matter.