0

I'm using jdk 1.8.0_131 and Apache POI 3.9

Because I've lots of calculations, my code is around 9k lines so I'm going to write a pseudocode of whats happening.

Loop for creating excel sheets
{
Creating Headers for that sheet
Creating content & Merging cells if they repeat
Autosizing columns
for(int j = 2; j < lastHeaderIndex+1;j++)
     sheet.autoSizeColumn(j);
}

I dont know is it because of merged cell or something but It only resizes as the headers (which are never merged). And I have some unmerged cells too. Like "Looong Heeeaderr" fits perfectly but the unmerged cell content below, "Looooooooooong Teeeeeeeext" only visible as "Looooooooooong T".

What am I doing wrong?

Jeredriq Demas
  • 616
  • 1
  • 9
  • 36
  • Have you tried [autoSizeColumn(int column, boolean useMergedCells)](https://poi.apache.org/apidocs/dev/org/apache/poi/ss/usermodel/Sheet.html#autoSizeColumn-int-boolean-)? So `sheet.autoSizeColumn(j, true);`? – Axel Richter Apr 09 '19 at 07:59
  • @AxelRichter dude... I've searched online and couldnt find it. If you post your comment as an answer I'll gladly accept it. – Jeredriq Demas Apr 10 '19 at 08:10

0 Answers0