Sami Asmar Sami Asmar - 1 year ago 106
Apache Configuration Question

Creating a header with two line in excel file with apache POI

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

my excel file

Answer Source

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


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.

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download