禁用数据透视表功能区

使用PivotTable.setEnableWizard禁用数据透视表功能区

以下代码通过访问工作表中的数据透视表,然后调用setEnableWizard来将此标志设置为false,演示了此功能。示例数据透视表文件可以从此链接下载。

// For complete examples and data files, please go to https://github.com/aspose-cells/Aspose.Cells-for-Java
// Open the template file containing the pivot table
Workbook wb = new Workbook("pivot_table_test.xlsx");
// Access the pivot table in the first sheet
PivotTable pt = wb.getWorksheets().get(0).getPivotTables().get(0);
// Disable ribbon for this pivot table
pt.setEnableWizard(false);
// Save output file
wb.save("out_java.xlsx");