我正在使用 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。这个问题解决了吗?