Hi,
Hi,
//Create a new WorkbookWorkbook workbook = new Workbook("E://Pt.xlsx");//Get the worksheet containing the Pivot TableWorksheet sheet = workbook.getWorksheets().get(1);//Hide the detailssheet.getPivotTables().get(0).getRowFields().get(0).hideDetail(true);//Set the RefreshDataOnOpeningFile flagsheet.getPivotTables().get(0).setRefreshDataOnOpeningFile(true);//Save the workbookworkbook.save("E://PivotCollapse.xlsx");
Thanks for the reply.
Hi,
Great! It worked! Is this only available in v7.x.x and not in 2.5.4?
Hi,
I have checked the code in the older version and found that it is available in the older version too.
Below is a code with little modifications that will run on the older version
Java
//Create a new Workbook
Workbook workbook = new Workbook();
workbook.open(“E:\Pt.xlsx”);
//Get the worksheet containing the Pivot Table
Worksheet sheet = workbook.getWorksheets().getSheet(1);
//Hide the details
sheet.getPivotTables().get(0).getRowFields().get(0).hideDetail(true);
//Set the RefreshDataOnOpeningFile flag
sheet.getPivotTables().get(0).setRefreshDataOnOpeningFile(true);
//Save the workbook
workbook.save(“E://PivotCollapse.xlsx”);
Hi,
Hi,
Thanks for letting me know.
I tested the code on Aspose.Cells for Java v2.5.4.20.
But since you do not have this patch, so you will have to upgrade your code to latest version.
I understand that we really need to upgrade to the latest version. But it takes time for us because we need to follow the company process. Is it possible that you give me the 2.5.4.20 version?
Hi,
I am afraid, this is against our policy to provide versions older than one year.