java poi 数据透视,Apache的POI:Excel数据透视表 - 行标签

I have a requirement to create a excel sheet in JAVA as below :

I am not able to create a row label with multiple columns side by side ( menus and submenus filter ).

Instead of displaying the submenu in different column, its coming under the menu column.

Below is the piece of code which i have written :

XSSFSheet sheet = my_xlsx_workbook.getSheetAt(0);

AreaReference a=new AreaReference("A1:G7");

CellReference b=new CellReference("I5");

XSSFPivotTable pivotTable = sheet.createPivotTable(a,b);

pivotTable.addReportFilter(0);

pivotTable.addReportFilter(1);

pivotTable.addRowLabel(2);

pivotTable.addRowLabel(3);

pivotTable.addColumnLabel(DataConsolidateFunction.SUM, 4, "Sum");

你可能感兴趣的:(java,poi,数据透视)