1

How can I get this header from java code with apache POI?

my excel file

centic
  • 15,565
  • 9
  • 68
  • 125
Sami Asmar
  • 131
  • 2
  • 13

1 Answers1

1

Usually you do that by merging two cells for all the "Projets" items.

See https://poi.apache.org/spreadsheet/quick-guide.html#MergedCells

Basically you define all the merged areas with calls like this

sheet.addMergedRegion(new CellRangeAddress(
        0, //first row (0-based)
        0, //last row  (0-based)
        0, //first column (0-based)
        1  //last column  (0-based)
));

See also Setting value to cells after merging in POI and Merging cells in Excel using Apache POI for more discussion around this.

Community
  • 1
  • 1
centic
  • 15,565
  • 9
  • 68
  • 125