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
Consolidated and refactored pivot sources #1238
Conversation
I rebased the pivot source to the current develop branch. Because the branch is 4 years old, rebase was complicated and pretty much every pivot test fails (some on exceptions), but that is fine. The premise of PR is sound, source should be separate from the table, so we can have multiple tables from same source. I want to do this, before I separate out the pivot writer class (saving pivot is 1000+LOC and should be more structured). A long way for merge:
|
Done:
Explicitly scoping out of this PR:
|
I have made a review of public API and slimmed it down. It boils down to "does it have a use case" and "is it API I am confident can grow"
I will also merge |
I renamed I kept only one method at this time: The methods for adding a new pivot tables, where a range is passed as an argument ( I need to do several rounds of reviews+cleanup+fixes (I haven't proofread anything yet), but API is now fine, there is a documentation and tests. Tests are limited to the current API scope (will be improved in subsequent PRs). |
Hi @jahav
Both errors seem to be caused by the same basic problem. Custom fields are not handled correctly (in my opinion). Both Excel documents were correctly processed with Version 0.76. |
Just to clarify, in v0.76 pivot tables were not supported. And ClosedXML read and wrote the files totally ignoring them. Whatever pivot tables were in the file were left untouched. Then we implemented support for adding/modifying pivot tables and obviously couldn't support every single feature from the beginning. This is the reason for the apparent regressions. |
Ok, got it. With 0.76 we were using Excel "Templates" which had Pivot Tables already defined. The only thing we were using ClosedXML for was, to fill a separate "data" Sheet that was then used as Source for the already existing Pivot Table. |
It's not perfect, but it's an improvement and good enough. A representation of a pivot cache is a required first step toward making pivot tables actually work. I also need to this to be merged, so I can separate out individual saving writers. @igitur Could you take a quick look? Saving part would be enough. I plan RC on Friday or Saturday. I know it's on a short notice, sorry about that. Work on phase 1 (long overdue architecture changes + dependencies changes) took precedence over phase 2 (deal with PR). |
Depends on #1237
Depends on #1233
Fixes #1039
WIP