excel

Docs › Reference

Report formats: result.report, upload body, error lists

The summary and report of check(), the body <excel-82> sends to your server, and the CSV and xlsx error lists.

With 0.2 rules, check() adds a summary (for people) and a report (for your server). The error list can be downloaded as CSV or xlsx. Personal data is masked everywhere except in the rows you upload.

import { check, makeErrorReport } from '82excel';
import { makeErrorReportXlsx } from '82excel/report-xlsx';   // separate chunk

const r = await check(file, { ...rules, readRows: true });
r.report;                                                     // the report for the server (a hint)
const csv = makeErrorReport(r, 'csv');                        // Blob, UTF-8 BOM
const xlsx = await makeErrorReportXlsx(r, r.rows, { rules });

result.report

FieldContent
schemaId, schemaVersionThe rules' id and version
schemaHashrulesHash(rules) as sha256:<hex>; compare with the server's hash of its own rules.json
lib82excel@<version>
file{ name, size, sha256, sheet, format }; sha256 is the hex hash of the file bytes
header{ row, columns: [{ key, source, col }] }: the header row and the columns found
stats{ rows, errors, warnings }: result rows and issue counts
issuesErrors, then warnings; personal data masked
checkedAtTime of the check (ISO 8601)

The example file orders-sample.xlsx checked with the home page's example rules (hashes shortened, two issues kept):

{
  "schemaId": "orders-upload",
  "schemaVersion": "3",
  "schemaHash": "sha256:f9cb5021…",
  "lib": "82excel@0.2.0",
  "file": { "name": "orders-sample.xlsx", "size": 12807, "sha256": "4afe7146…", "sheet": "Sheet1", "format": "xlsx" },
  "header": { "row": 1, "columns": [
    { "key": "orderNo", "source": "주문 번호", "col": "A" },
    { "key": "orderDate", "source": "주문일", "col": "B" },
    { "key": "amount", "source": "금액", "col": "C" }, …
  ] },
  "stats": { "rows": 10, "errors": 8, "warnings": 0 },
  "issues": [
    { "code": "CELL_PATTERN", "severity": "error", "message": "Row 3, column A (주문번호): Does not match the required pattern",
      "row": 3, "col": "A", "key": "orderNo", "header": "주문번호", "rule": "pattern", "raw": "ORD-12", "value": "ORD-12" },
    { "code": "CELL_DATE", "severity": "error", "message": "Row 4, column B (주문일): Date does not exist",
      "row": 4, "col": "B", "key": "orderDate", "header": "주문일", "rule": "type", "raw": "2024-13-01", "reason": "invalid" }, …
  ],
  "checkedAt": "2026-10-22T06:44:39.367Z"
}

A cell issue is { code, severity, message, row, col, key, header, rule, raw, value? }. row is the row number as Excel shows it (1-based, header included), header the header from the rules, raw the original value (masked), and value the cleaned value when the type was right.

result.summary

Cell issues grouped by column and code, with up to 3 examples in row order. The component's summary list ("Column C (Amount): Invalid amount (120) — row 3 '1천원', row 7 '-'") is drawn from it.

[
  { "key": "orderNo", "col": "A", "header": "주문번호", "code": "CELL_PATTERN", "severity": "error", "count": 1,
    "examples": [{ "row": 3, "raw": "ORD-12" }] },
  { "key": "orderDate", "col": "B", "header": "주문일", "code": "CELL_DATE", "severity": "error", "count": 1,
    "examples": [{ "row": 4, "raw": "2024-13-01" }] }, …
]

Upload body

The default (upload-as="json") body of <excel-82 upload=…> with 0.2 rules, sent as Content-Type: application/json.

{
  "fileName": "orders.xlsx",
  "sheet": "Sheet1",
  "schema": { "id": "orders-upload", "version": "3", "hash": "sha256:…" },
  "columns": ["orderNo", "date", "phone", "amount"],
  "rows": [{ "$row": 2, "orderNo": "AB000001", "date": "2024-01-05", "phone": "010-1234-5678", "amount": 12000 }],
  "report": { "schemaHash": "sha256:…", "lib": "82excel@0.2.0", "file": { "sha256": "…" }, "…": "…" }
}
  • rows are cleaned and not masked; $row is the Excel row number. With upload-report="off" there is no report key.
  • upload-file="include": multipart/form-data with file (named by upload-field, default file), data (the JSON above without report) and report (the report JSON).
  • upload-as="file": multipart with file and report.
  • The server checks again with validate(body.rows, rules) (Server second pass).

CSV error list

makeErrorReport(result, 'csv', { locale? }) returns a CSV Blob with a UTF-8 BOM. Columns: row, column, header, original value, message, code, severity; errors first, then warnings. Values that could run as formulas in Excel get a leading ', and values are already masked. It also serves as a server's 422 body (a validate() result has column letters only with the columnLetters option).

Row,Column,Header,Original value,Message,Code,Severity
3,A,주문번호,ORD-12,"Row 3, column A (주문번호): Does not match the required pattern",CELL_PATTERN,error
4,B,주문일,2024-13-01,"Row 4, column B (주문일): Date does not exist",CELL_DATE,error
5,C,금액,1천원,"Row 5, column C (금액): Invalid amount",KR_AMOUNT,error

xlsx error list

  • makeErrorReportXlsx(result, rows, { rules?, locale?, sheetName? }) (82excel/report-xlsx) colours error cells red and warning cells yellow on the data sheet, adds comments and an "Errors" sheet, and resolves to an xlsx Blob.
  • With rules, data values are masked by the same rules (without it, only values that look like resident registration numbers). The original formatting is not kept.
  • On the CDN it is 82excel.report-xlsx.min.js (global Excel82ReportXlsx). <excel-82 error-report="xlsx"> loads it from next to the CDN file on the first click (override with report-xlsx-src). Sheet and column names exist in English and Korean only.