Discussion:
Why would sheet.setColumnWidth hide the column?
Zac Morris
2014-03-07 16:53:47 UTC
Permalink
Why would

sheet.setColumnWidth({cellnum},{(int)#ofchars});

...be causing those columns to be hidden?

Because of a very large data-set I'm using SXSSFWorkbook, so trying to use:

sheet.autoSizeColumn({colnum}) just isn't reliable (because of the limited
number of rows in memory), so I'd rather set a specific width instead, but
every time I try the end result is that the column is hidden.

I've tried when I first create the sheet, and after I've written all the
rows, and both result in the column being hidden in the file.


Ideas?
David Law
2014-03-08 07:45:28 UTC
Permalink
Hi Zac,

having read the Javadoc, I would suggest you try:

sheet.setColumnWidth({cellnum}, {(int)#ofchars} * 256);


All the best,
DaveLaw
Post by Zac Morris
Why would
sheet.setColumnWidth({cellnum},{(int)#ofchars});
...be causing those columns to be hidden?
sheet.autoSizeColumn({colnum}) just isn't reliable (because of the limited
number of rows in memory), so I'd rather set a specific width instead, but
every time I try the end result is that the column is hidden.
I've tried when I first create the sheet, and after I've written all the
rows, and both result in the column being hidden in the file.
Ideas?
Loading...