fix(xlsx/pivot): pad rowItems subtotal entries per ECMA-376 spec#47
Open
BubbleWolf wants to merge 1 commit intoiOfficeAI:mainfrom
Open
fix(xlsx/pivot): pad rowItems subtotal entries per ECMA-376 spec#47BubbleWolf wants to merge 1 commit intoiOfficeAI:mainfrom
BubbleWolf wants to merge 1 commit intoiOfficeAI:mainfrom
Conversation
BuildTreeAxisItems (N>=3) and BuildMultiRowItems (N=2) emitted fewer <x> children than required for subtotal <i> elements. ECMA-376 §18.10.1.44 requires exactly (fieldCount - r) children per entry. Pad subtotal entries with the "default" item index for each deeper field so Excel can correctly rebuild the row hierarchy when the user manually refreshes the pivot table.
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.
Summary
BuildMultiRowItems(N=2 row fields) andBuildTreeAxisItems(N≥3 row fields) to emit the correct number of<x>children per subtotal<i>elementfieldCount - rchildren, but subtotal entries only emitted 1 regardless of depthRoot Cause
Subtotal rows represent an aggregate across all children. The code emitted only the current level's value as a single
<x>child, but the spec requires values for all deeper fields too (using the "default" item index — the last entry in each pivotField's items list). Without padding, Excel's pivot refresh engine cannot reconstruct the row hierarchy and shows an empty data area.Test plan
rows=Region,Country) and verify subtotal rows render correctly in Excel after manual refreshrows=Region,Country,Category,Product) and verify the same