0

I've tried autoSizing Excel-columns I made with Jython + Apache POI. I found the this thread: Apache POI Excel - how to configure columns to be expanded?, but I still can't figure it out.

I've tried adding 'sheet1.autoSizeColumn(1)' but it doesn't change anything. And wouldn't it be better to call that on every available column, because why wouldn't you want every column to be nicely formatted?

Maybe it just isn't possible in Jython?

Kind regards, Kristof.

Community
  • 1
  • 1
  • If you have one row with really wide data, you wouldn't necessarily want to size the column based just on that, so it's not a universal requirement – Gagravarr Apr 25 '12 at 14:12

1 Answers1

1

When are you calling the autoSizeColumn method? Before or after setting the data?

You should call the 'sheet.autoSizeColumn(1)' method only after setting all the values for the column in question.

If you call it before it won't have any effect, as it doesn't have any data to base the resizing of.

phss
  • 1,012
  • 10
  • 22