Liasse
Components

multi-sheet-report

Multiple sections, each on its own sheet, preceded by a summary sheet that aggregates every section.

Multiple sections, each rendered on its own worksheet, preceded by a leading summary sheet that aggregates the key figure of every section into one table (plus any headline KPIs).

import { multiSheetReport } from "@liasse/components";
import { render } from "@liasse/core";
import "@liasse/xlsx";

const doc = multiSheetReport({
  title: "Q3 2026 Report",
  summaryKpis: [
    { label: "Total revenue", value: 622350, format: "currency" },
    { label: "Growth", value: 0.097, format: "percent" },
  ],
  sections: [
    {
      title: "Detail",
      columns: [
        { key: "item", header: "Item" },
        { key: "q3", header: "Q3", format: "currency", align: "right" },
      ],
      rows: [
        { item: "Subscriptions", q3: 472900 },
        { item: "Licenses", q3: 61300 },
      ],
      totals: ["q3"],
    },
    {
      title: "Assumptions",
      columns: [
        { key: "assumption", header: "Assumption" },
        { key: "value", header: "Value", format: "percent", align: "right" },
      ],
      rows: [
        { assumption: "Monthly churn", value: 0.018 },
        { assumption: "Expansion", value: 0.042 },
      ],
    },
  ],
});

const bytes = await render(doc, { format: "xlsx" });

The result is a workbook with a Summary sheet first (KPIs + a one-row-per-section aggregate, totalled), then one sheet per section — each with its own frozen header and =SUM row.

Input

FieldTypeDescription
titlestringDocument title.
summaryKpis?SummaryKpi[]Headline figures on the summary sheet.
sectionsReportSection[]Each becomes its own sheet.
summaryTitle?stringLabel for the summary sheet (default "Summary").

On this page