-
Notifications
You must be signed in to change notification settings - Fork 807
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
Fix error by two pivot with one source #1195 #1196
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Preliminary feedback
@b0bi79 You have to revert the old files in |
@b0bi79 Can you please give me access to push some changes to you |
This option is on. Now I will give full access to the repository. |
You are now an collaborator. |
9bbd39c
to
39c76cc
Compare
Thanks for the contribution. I made some additional changes to avoid having to clone elements. It's becoming clear that we'll need a big refactor of pivot tables to allow references to shared pivot sources. But for now, I think this PR is fine. Do you agree with my additional changes? |
Thank you, Francois. I checked it with my tests, all works. |
@Pankraty Would you mind doing a quick check on this PR too? It will soon be refactored anyway. commit history for this PR will be squashed. |
What's this PR do?
I created in MS Excel a file containing two Pivot on different sheets, the data source for which is a table with data. Then I opened this file in ClosedXML and changed the data in the data table and saved the file. When opening the received file, MS Excel displays an error:
Deleted component: Component /xl/pivotTables/pivotTable1.xml. (Summary Table View)
Deleted Records: PivotTable Report from Part /xl/workbook.xml (Book)
The reason that in the pivotCacheDefinition the TaxRate field was not filled in was that the file was generated based on a template in which two summary tables are constructed from data from the same data table. In this case Excel creates one pivotCacheDefinition file, and ClosedXML while caches the last Pivot overwrites the cache for the first Pivot.
How should this be manually tested?
The test ClosedXML_Tests.XLPivotTableTests.TwoPivotWithOneSourceTest()
Fixes #1195