feat(core): B1.1 — per-output views (multi-view hook) - #65
Merged
Conversation
First code of Epic B1, OSS/MIT. A single source read can now feed several outputs, each with its own filters and/or columns (a "view"), producing one file per view. The Pro workbook writer (views as sheets in one .xlsx) is B1.2. - ReportBuilder<T>.To(spec, view => view.Where(...).Column(...)) declares an output's own view; To(spec) keeps using the report's filters/columns. - The pipeline projects PER OUTPUT in a single pass: TypedBatchReader<T> takes one OutputProjection<T> (filters + getters) per output; ProjectedBatch carries per-output rows plus a WrittenCount (distinct source rows written to >=1 output). CompiledReport gains OutputSchemas (per-output schema); the runner initializes each writer with its own schema and writes batch.Outputs[i] to output i. - Default single-output path is byte-identical (all existing tests green): recordsWritten uses WrittenCount, which equals the old batch.Rows.Count when outputs share a projection. Tests: 54 green Core (+3) — views filter/project independently from one read; a shared row counts once; a view without columns (and no report columns) is rejected. Jobs (16) and AspNetCore (10) unaffected. Docs: PLAN B1.1 done; design doc + DECISIONS record the multi-view model and the resolved decisions (package NeoReports.Xlsx.Pro; license Option A QuestPDF-style / PolyForm Small Business, free < USD 1M, no enforcement; CSV-with-views rejects; multi-source = two explicit join strategies).
Explicit types where not apparent (IDE0008), collection expressions for the view lists (IDE0028), and in the test the Page return type and hoisted expected arrays (CA1859/CA1861). No behavior change; 54 green.
|
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.



First code of Epic B1 — OSS/MIT. A single source read can now feed several outputs, each with its own filters and/or columns (a "view"), producing one file per view. The Pro workbook writer (views → sheets in one
.xlsx) is B1.2.This is the general "multi-view" model from your 2.5 clarification: at save time, several outputs with distinct filters/columns; each targets its own file here (free), or gets packed as sheets in one workbook (Pro).
API
To(spec)(no view) is unchanged — it uses the report's filters/columns.Pipeline change (additive, default path byte-identical)
TypedBatchReader<T>takes oneOutputProjection<T>(filters + getters) per output and projects them all in one pass;ProjectedBatchcarries per-output rows + aWrittenCount(distinct source rows written to ≥1 output).CompiledReportgainsOutputSchemas; the runner initializes each writer with its own schema and writesbatch.Outputs[i]to output i.recordsWrittenusesWrittenCount, which equals the oldbatch.Rows.Countwhen outputs share a projection — so all existing behavior is preserved.Tests
54 green Core (+3): views filter/project independently from one read; a row in several views counts once; a view with no columns (and no report columns) is rejected. Jobs (16) and AspNetCore (10) unaffected — the single-output pipeline is byte-identical.
Docs
PLAN B1.1 ✅; the design doc + DECISIONS record the multi-view model and the resolved calls: package
NeoReports.Xlsx.Pro; license Option A (QuestPDF-style / PolyForm Small Business — free < USD 1M, paid above, no enforcement); CSV-with-views rejects; multi-source (B2) = two explicit join strategies.Next
B1.2 — the
NeoReports.Xlsx.Propackage:XlsxWorkbook(...)fluent API + ClosedXML writer that packs views as sheets in one file, plus the PolyForm Small BusinessLICENSE.