Skip to content

feat(core): B1.6 — dynamic-config support for workbook/sectioned outputs - #69

Merged
thiagoluga merged 2 commits into
masterfrom
feat/b1-6-dynamic-workbook
Jul 1, 2026
Merged

feat(core): B1.6 — dynamic-config support for workbook/sectioned outputs#69
thiagoluga merged 2 commits into
masterfrom
feat/b1-6-dynamic-workbook

Conversation

@thiagoluga

Copy link
Copy Markdown
Owner

The dynamic (JSON config) path can now target a multi-sheet workbook (or any sectioned output), closing Epic B1.

Config

An output declares sections to become a single-file, multi-section output:

{
  "outputs": [
    {
      "format": "xlsx-workbook",
      "sections": [
        { "name": "Approved", "filter": { ">":  [ { "var": "Amount" }, 0 ] } },
        { "name": "Rejected", "filter": { "<=": [ { "var": "Amount" }, 0 ] }, "columns": [ "Id", "Customer" ] }
      ]
    }
  ]
}
  • name → the worksheet (tab) name.
  • filter → a JsonLogic object (same as the report filter).
  • columns → an ordered subset of the report's column names (omit = all report columns).

Changes (additive)

  • Abstractions: OutputConfig.Sections + new SectionConfig (Name, Filter, Columns).
  • Core: ReportConfigCompiler splits regular vs sectioned outputs, resolves an ISectionedWriterFactory by format, and builds ToSections(...) — section filters via JsonLogicFilter, section columns resolved from report columns by name.
  • NeoReports.Xlsx.Pro: AddXlsxWorkbook() registers the writer as an ISectionedWriterFactory (format xlsx-workbook).

Tests

56 green Core (+1): a config with a sectioned output runs through the pipeline; a fake sectioned writer receives the right per-section rows/columns (Big: Id>1, all columns; Small: Id<=1, one column). Plus a Pro DI test that AddXlsxWorkbook registers a resolvable xlsx-workbook factory. The real writer is already covered by the B1.3 golden test.

Epic B1 status

B1.1–B1.3, B1.5, B1.6 ✅. Remaining: B1.4 — paste the verbatim PolyForm Small Business text into LICENSE.txt and decide the Pro package's distribution (both yours).

A config-driven report can now target a multi-sheet workbook (or any sectioned output).

- Abstractions: OutputConfig gains Sections; new SectionConfig (Name, JsonLogic Filter,
  optional Columns = subset of report column names). Additive.
- Core: ReportConfigCompiler splits outputs into regular (IWriterFactory) and sectioned
  (resolves an ISectionedWriterFactory by format) and builds ToSections(...) — each section's
  filter compiled via JsonLogicFilter, its columns resolved from the report columns by name
  (defaulting to all report columns). The section filter accepts JsonLogic object syntax in
  JSON, captured by the existing string converter.
- NeoReports.Xlsx.Pro: AddXlsxWorkbook() DI helper registers the workbook writer as an
  ISectionedWriterFactory (format "xlsx-workbook") so config reports can target it.

Tests: 56 green Core (+1) — a config with a sectioned output runs through the pipeline and a
fake sectioned writer receives the right per-section rows/columns; plus a Pro DI test that
AddXlsxWorkbook registers a resolvable "xlsx-workbook" factory. PLAN B1.6 done.
@sonarqubecloud

sonarqubecloud Bot commented Jul 1, 2026

Copy link
Copy Markdown

@thiagoluga
thiagoluga merged commit bfe12af into master Jul 1, 2026
5 checks passed
@thiagoluga
thiagoluga deleted the feat/b1-6-dynamic-workbook branch July 1, 2026 12:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant