You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Zac Morris <za...@zacwolf.com> on 2014/03/07 17:53:47 UTC

Why would sheet.setColumnWidth hide the column?

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?

Re: Why would sheet.setColumnWidth hide the column?

Posted by David Law <Da...@apconsult.de>.
Hi Zac,

having read the Javadoc, I would suggest you try:

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


All the best,
DaveLaw

On 07/03/2014 17:53, Zac Morris wrote:
> 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?
>


---------------------------------------------------------------------
To unsubscribe, e-mail: user-unsubscribe@poi.apache.org
For additional commands, e-mail: user-help@poi.apache.org