We're sorry Aspose doesn't work properply without JavaScript enabled.

Free Support Forum - aspose.com

Refresh pivot table removes the pivot table's formatting when converting to PDF

Hi,

I have a pivot table with formatting changes. When I refresh the pivot table programmatically with Aspose and convert to PDF, the formatting will change. Attached is the excel file I am using and this is my code:

try{
System.out.println(“Begin”);
Workbook wb=new Workbook(“testExcel.xlsx”);
PivotTable table = wb.getWorksheets().get(1).getPivotTables().get(0);
table.setPreserveFormatting(true);
table.refreshData();
table.calculateData();
wb.save(“testExcel.pdf”,SaveFormat.PDF);
System.out.println(“End”);
} catch (Exception e){
e.printStackTrace();
}


Hi,


Thanks for the template file and sample code.

After an initial test, I observed the issue as you mentioned. By calling PivotTable.refreshData() and PivotTable.calculateData() would remove the formatting (percentage values are changed to their base values) when rendering to PDF file format.
e.g
Sample code:

System.out.println(“Begin”);
Workbook wb=new Workbook(“testExcel.xlsx”);
PivotTable table = wb.getWorksheets().get(1).getPivotTables().get(0);
table.setPreserveFormatting(true);
table.refreshData();
table.calculateData();
wb.save(“out1.pdf”,SaveFormat.PDF);
System.out.println(“End”);

I have logged a ticket with an id “CELLSJAVA-41098” for your issue. We will look into it soon.

Once we have some update on it, we will let you know here.

Thank you.

Hi,


Please try our latest version/fix: Aspose.Cells for Java v8.3.1.1

We have fixed your issue now.

Let us know your feedback.

Thank you.

The issues you have found earlier (filed as CELLSJAVA-41098) have been fixed in this update.


This message was posted using Notification2Forum from Downloads module by Aspose Notifier.