feat(core): B1.6 — dynamic-config support for workbook/sectioned outputs - #69
Merged
Conversation
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.
|
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



The dynamic (JSON config) path can now target a multi-sheet workbook (or any sectioned output), closing Epic B1.
Config
An output declares
sectionsto 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)
OutputConfig.Sections+ newSectionConfig(Name, Filter, Columns).ReportConfigCompilersplits regular vs sectioned outputs, resolves anISectionedWriterFactoryby format, and buildsToSections(...)— section filters viaJsonLogicFilter, section columns resolved from report columns by name.NeoReports.Xlsx.Pro:AddXlsxWorkbook()registers the writer as anISectionedWriterFactory(formatxlsx-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 thatAddXlsxWorkbookregisters a resolvablexlsx-workbookfactory. 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.txtand decide the Pro package's distribution (both yours).