Free Support Forum - aspose.com

Refreshing PivotTable corrupts file

Using the latest Aspose.Cells for .NET 17.10, it results in the pivot table portion of the file becoming corrupted and Excel prompting with a message to recover content when attempting to open.

Attached is a template that demonstrates the issue.
example.zip (12.2 KB)

The example xlsx file can be opened fine in Excel. It contains a pivot table one the first worksheet that is generated using data from a named range on the second worksheet. After calling the RefreshPivotTables routine on the worksheet containing the pivot table, and then saving, the resulting file will then be corrupted.

Here is the sample code that demonstrates the problem:

    Dim workBook As New Aspose.Cells.Workbook("c:\temp\example.xlsx")
    Dim pivot As Aspose.Cells.Pivot.PivotTable = workBook.Worksheets(0).PivotTables(0)
    workBook.Worksheets(0).RefreshPivotTables()
    workBook.Save("c:\temp\result.xlsx")

When opening the result file Excel will prompt with an error message stating that there is a problem with some content. By telling it to proceed it will indicate that it is the pivot table causing the issue. The repaired file is then missing some necessary content that the original contained.

@chrism.peloton

Thanks for using Aspose APIs.

We were able to observe this issue and logged it in our database for investigation and for a fix. Once, the issue is resolved or we have some other news for you, we will let you know asap.

This issue has been logged as

  • CELLSNET-45731 - Refreshing PivotTable corrupts Excel file

C#

Aspose.Cells.Workbook workBook = new Aspose.Cells.Workbook("example.xlsx");
Aspose.Cells.Pivot.PivotTable pivot = workBook.Worksheets[0].PivotTables[0];
workBook.Worksheets[0].RefreshPivotTables();
workBook.Save("result.xlsx");

Screenshot

@chrism.peloton

Thanks for using Aspose APIs.

This is to inform you that we have fixed your issue CELLSNET-45731 now. We will soon provide the fix after performing QA and including other enhancements and fixes.

@chrism.peloton

Thanks for using Aspose APIs.

Please download and try the following latest fix and let us know your feedback.

The issues you have found earlier (filed as CELLSNET-45731) have been fixed in this Aspose.Cells for .NET 17.12 update.

Please also check the following article:

Hi, i noticed the same problem for Aspoce.Cells for Java.
I’m using the version 18.3

@quaresimaan,

Please provide us sample (Java) code (runnable) and template file to reproduce the issue on our end, we will check it soon.