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';

// A valid licenseKey is required β€” without one the Pro grid is locked.
const { worksheet } = createReogrid('#grid', { licenseKey: 'YOUR-LICENSE-KEY' });

// ...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
Merged cellsPreserved as xlsx merges
BordersAll four sides per cell
Row heights / column widthsExact pixel β†’ point conversion
Conditional formattingcellIs, expression, containsText rules

Round-trip: loadXlsx β†’ saveAsXlsx preserves all of the above. Number formats and images are currently import-only β€” they are read from xlsx but not written back on export.

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: ArrayBuffer = 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.