Apache POI : Excel Pivot Table - Row Label
<p>I have a requirement to create a excel sheet in JAVA as below :</p>

<p><a href="https://i.stack.imgur.com/Y6GPb.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/Y6GPb.png" alt="enter image description here"></a></p>

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

<p>Instead of displaying the submenu in different column, its coming under the menu column.</p>

<p>Below is the piece of code which i have written :</p>

<pre><code>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");   
</code></pre>

<p>But its getting wrongly displayed as below :</p>

<p><a href="https://i.stack.imgur.com/4luCV.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/4luCV.png" alt="enter image description here"></a></p>

<p>Can someone please help me ?</p>