Apache POI autoSizeColumn() not working right [duplicate]
You just need to move the call to
sheet.autoSizeColumn(columnNumber);
to a point in your code after the data has been added.
Here is a link to the API
That's the only way to do it. I had same problem, I was calling the method autoSizeColumn()
before I entered the data. Hop it helped
Move the for loop :
for (int j = 0; j < 6; j++) { s.autoSizeColumn(j); }
to be just before you write in the workbook and close your out object.
wb.write(out);