I have been searching for a while, and haven't been able to find a solution as yet.
This question has been asked before on here but the OP didn't get a response and I didn't want to resurrect an old thread so decided on asking a new question. The OP thread is here.
The problem I'm having is that I've got a spreadsheet which is created with data obtained from a database, however sometimes the data within cells can be quite lengthy, so wanted POI to autosize to save the user having to do it, but because I'm setting autofilter before calling autosize, it's not quite working.
I'm using Apache POI 3.9.
I either get it to a point where it's autosized but hasn't taken into account the autofilter dropdown arrow, or I get a null pointer exception.
I've tried moving a for loop all over the place, including at the end of where the data is written to the spreadsheet, and also to just before the file output stream, but to no avail.
I have also tried using a couple of different fonts but that hasn't worked either.
Hoping someone can help me out please.
Thanks
excelSheet.autoSizeColumn(new Short(String.valueOf(i)));
intoexcelSheet.autoSizeColumn(i);
which would be easier to read :) – Ietta