I created a pivot table using Apache POI 3.11. like this:
FileInputStream file = new FileInputStream(new File(path+fname)); XSSFWorkbook workbook = new XSSFWorkbook(file); XSSFSheet sheet = workbook.getSheetAt(0); //area of pivot data AreaReference a=new AreaReference("A1:J4"); CellReference b=new CellReference("N5"); XSSFPivotTable pivotTable = sheet.createPivotTable(a,b); //insert row pivotTable.addRowLabel(3); pivotTable.addRowLabel(6); //insert column pivotTable.addColumnLabel(DataConsolidateFunction.COUNT, 5); //export FileOutputStream output_file = new FileOutputStream(new File(path+"POI_XLS_Pivot_Example.xlsx")); workbook.write(output_file);//write excel document to output stream output_file.close(); //close the file
After I generated the report, it correctly displays the line. But it does not show the column label:

I want to display the column label in my pivot table as follows:

(source: pivot-table.com )
Does anyone know a solution to this problem?
Thank you
source share