V4 V5

The structure of reogrid-json. It is shared with the web edition (reogrid-web), and unknown keys are ignored silently.

The document

{
  "format": "reogrid-json",
  "version": 1,
  "styles": [ ... ],
  "numberFormats": [ "#,##0", "yyyy/mm/dd" ],
  "definedNames": [ ... ],
  "workbook": { "activeSheet": 0, "sheets": [ ... ] }
}
KeyWhat it is
formatAlways "reogrid-json"
versionCurrently 1
stylesThe style table; cells reference it by index
numberFormatsThe format-code table; likewise
definedNamesDefined names
workbookThe workbook itself

Styles and number formats are collected into tables, so tens of thousands of cells sharing a format add nothing to the file size.

definedNames

{ "name": "SalesData", "scope": null, "address": "Sheet1!A2:C100" }

A null scope means workbook scope; a sheet name means that sheet’s scope.

A worksheet

{
  "name": "Sheet1",
  "rowCount": 1048576,
  "columnCount": 16384,
  "defaultRowHeight": 20,
  "defaultColumnWidth": 80,
  "rows": { ... },
  "cols": { ... },
  "cells": [ ... ],
  "merges": [ ... ],
  "borders": [ ... ],
  "outlines": { ... },
  "cellTypes": [ ... ],
  "conditionalFormats": [ ... ],
  "filter": { ... }
}

Optional keys are omitted when their content is empty.

cells

Only cells that exist appear.

{ "r": 0, "c": 0, "v": 1200, "f": "SUM(A1:A2)", "s": 3, "nf": 1, "rt": [ ... ] }
KeyWhat it is
r / cRow and column (zero-based)
vThe value
fThe formula (without the leading =)
sAn index into the styles table
nfAn index into the numberFormats table
rtRich-text runs

rt (rich text)

[ { "text": "Total " },
  { "text": "12,800", "bold": true, "color": "#cc0000" } ]

The keys are text, bold, italic, underline, fontFamily, fontSize and color.

cellTypes

Saved scoped to a range.

{ "r": 0, "c": 0, "rs": 1048576, "cs": 1, "config": { "type": "checkbox" } }

rs / cs are the row and column counts. What is inside config is whatever the cell type wrote in WriteConfig (Custom Cell Types).

outlines

{
  "rows": [ [ { ... } ], [ { ... } ] ],
  "columns": [ ... ],
  "rowsSummaryBelow": true,
  "columnsSummaryRight": true
}

rows / columns are an array per nesting level (index 0 is the outermost).

filter

{
  "headerRow": 0,
  "startColumn": 0,
  "endColumn": 3,
  "columns": [
    { "column": 1, "selectedValues": ["Tokyo", "Osaka"],
      "condition": { "op": "greaterThan", "value": "1000" } }
  ]
}

The setup and the per-column selected values round-trip. Row visibility is recomputed on load.

condition is a V5 extension (the web edition ignores it).

Colors

Written as "#rrggbb". Alpha is omitted and treated as opaque.

What is not saved

Scroll position, selection, freeze panes, zoom and the undo history — all run-time state.

Was this article helpful?