Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

WIP Pivot subtotal styles #1821

Open
wants to merge 9 commits into
base: develop
Choose a base branch
from
Open

Conversation

jahav
Copy link
Member

@jahav jahav commented Jun 21, 2022

Add an ability to remove a subtotal from a pivot table and fix the styles. ClosedXML should be clear that default subtotal is in the field. ASIS - empty Subtotals mean default, TOBE - empty subtotals means no subtotal, XLSubtotalFunction.Automatic means default, any additional subtotal function overrides the default.

It modifies the API, from XLPivotField.AddSubtotal(XLSubtotalFunction) to XLPivotField.SetSubtotal(XLSubtotalFunction, bool), but it is either this or additional functions like RemoveSubtotal. Since it is not possible to affect the order of subtotals, this seems better.

Second thing is styling - it's not possible to style other subtotal function other than default one. even this is a partial solution, because it doesn't style label of a subtotal, but at least it is an improvement.

@igitur igitur self-requested a review June 23, 2022 08:41
@igitur
Copy link
Member

igitur commented Jun 23, 2022

Hi, I definitely want to review this one before merging, please.

@jahav jahav changed the title Pivot subtotal styles WIP Pivot subtotal styles Jun 23, 2022
@jahav
Copy link
Member Author

jahav commented Jun 23, 2022

@igitur It is missing ability to load saved file that has subtotals in some fields and and not in others. I had some problems with XML comparing, so I worked on it. It is mostly to solve issue that I can't style functions other than default subtotal.

…est files, in most cases it removes defaultSubtotal from fields that shouldn't have subtotal (e.g. fields unused in the table or data fields)
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.

None yet

2 participants