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)