0

我正在使用 aspose-cells-8.7.2-java。当我刷新数据透视表并保存时,excel 文件已损坏。当我尝试打开 excel 文件时,我收到如下警告消息:

"Excel found unreadable content in 'Book1.xlsx'.Do you want to recover the contents of this workbook?If you trust the source file of this workbook, click yes."

代码如下:

Workbook wb = new Workbook("Book1.xlsx");
PivotTable pt = wb.getWorksheets().get(1).getPivotTables().get(0);
pt.refreshData();
pt.calculateData();
wb.save("Book1.xlsx");

有什么帮助吗?

我发现这个线程将相同的问题记录为票证: http ://www.aspose.com/community/forums/thread/683715/aspose.cells-generates-a-corrupted-xlsx-file-excel-2007-无法打开.aspx。这个问题解决了吗?

4

1 回答 1

1

恐怕记录的问题尚未解决。顺便说一句,您使用类似的 Excel 文件还是您的模板文件“Book1.xlsx”不同。此外,您的问题可能是特定于模板的(如果您使用不同的文件)并且可能有不同的场景,因此我们需要您的模板“Book1.xlsx”文件来正确评估您的问题。我们建议您使用您的模板 Excel 文件在 Aspose.Cells论坛中创建一个单独的主题,我们将评估您的问题并在那里更好地帮助您。

我在 Aspose 担任支持开发人员/传播者。

于 2016-04-18T17:42:22.290 回答