The PivotTable format is lost after the worksheet is copied many times

The PivotTable format is lost after the worksheet is copied many times
The original worksheet contains a pivot table. Add a sheet, copy the original worksheet, save it as Excel, and find that the pivot table in the new worksheet is normal; However, after copying the worksheet with the same operation again, it is found that the pivot table in the new worksheet is lost and becomes common content
image.png (92.1 KB)
image.png (125.9 KB)

this is my code

Workbook workbook = new Workbook(“D://Aspose//EPPR_54320//EPPR_54320.xlsx”);
WorksheetCollection worksheets = workbook.getWorksheets();
Worksheet worksheet = worksheets.get(0);
int idx = worksheets.add();
Worksheet tmp = worksheets.get(idx);
tmp.copy(worksheet);
workbook.save(“D://Aspose//EPPR_54320//output//EPPR_54320_1.xlsx”);

worksheet = worksheets.get(1);
idx = worksheets.add();
tmp = worksheets.get(idx);
tmp.copy(worksheet);
workbook.save(“D://Aspose//EPPR_54320//output//EPPR_54320_2.xlsx”);

this is my excel:EPPR_54320.zip (63.3 KB)

@xhaixia,

Thanks for the template file and screenshots.

Which version of Aspose.Cells for Java you are using? I tested your scenario/case with your template file and sample using our latest version/fix: Aspose.Cells for Java v22.7 (Download | Maven), it works fine. The pivot table is retained and is not lost.

Please try our latest version (Aspose.Cells for Java v22.7) and let us know if you still find any issue.