Open jamesSampica opened 5 years ago
This just bit me also. We don't even use EPPlus to control any of the pivot tables, we merely open a template workbook and use EPPlus to write the raw data into it.
Thanks for the tip about downgrading to 4.5.0.3-rc (N.B. one will need to check the Include prerelease
checkbox in NuGet.)
I tried to reproduce this issue with a minimal document with a basic pivot table but that actually worked OK. I can send through a cut-down version of my template workbook that does cause this problem if that will help.
The unit test I provided is fairly simple. Is there something you can find in the api that triggers this problem?
I'm experiencing this problem also with EPPlus version 4.0.5.0
All I do is read the file into FileInfo, create a package, and save. With no exception or anything. Then by opening the file in Excel, it says: It found a problem, and it might try to recover the file. The result is a file with some removed parts:
Removed Part: /xl/pivotTables/pivotTable1.xml part. (PivotTable view) Removed Feature: PivotTable report from /xl/pivotCache/pivotCacheDefinition1.xml part (PivotTable cache) Removed Records: Workbook properties from /xl/workbook.xml part (Workbook) Removed Records: Sparklines from /xl/slicerCaches/slicerCache1.xml part (Slicer Cache) Removed Records: Sparklines from /xl/slicerCaches/slicerCache2.xml part (Slicer Cache) Removed Records: Sparklines from /xl/slicerCaches/slicerCache3.xml part (Slicer Cache) Removed Records: Slicer Cache from /xl/slicers/slicer1.xml part (Slicer)
When adding, saving, reopening, and then saving packages with pivot tables Excel 2016 complains that there was unreadable content for the pivot table definitions.
The code itself does not throw any errors. Only when opening the file does the problem occur.
I created a test based on Sample12 highlighting the problem. Here is the output excel.zip
The file opens successfully and pivot tables are generated correctly in versions <=4.5.0.3rc but fail in versions >=4.5.1