You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by "Maurya, Dilip" <di...@bankofamerica.com> on 2009/04/01 16:11:54 UTC

Column auto size not working.

Hi List,

 

I am using an HSSFWorkbook and writing data with different cell styles
to it. Once all the data is written and necessary styles applied, I call
the autoSizeColumn((short)i) method on all the columns of the sheet to
fit contents. This seems to work fine in my local app server, but when
put it in a different server, the columns don't auto-fit. The cells show
###### instead of the data. I have to resize the column header to see
the data.

 

Not sure if there are some server settings that needs to be tweaked.

 

Thanks,

Dilip Maurya.


RE: Column auto size not working.

Posted by "Maurya, Dilip" <di...@bankofamerica.com>.
Hi Yegor,

I figured out that it was due to bold font. The server is able to
measure the font but not when it is bold. Any suggestions on that?

-Dilip

-----Original Message-----
From: Yegor Kozlov [mailto:yegor@dinom.ru] 
Sent: Thursday, April 02, 2009 3:41 AM
To: POI Users List
Subject: Re: Column auto size not working.

autoSizeColumn uses Java2D to measure text. If some of the fonts are not
available, JDK uses the default font and the 
result can be "off".

If any fonts are missing in production you need to install them and
  copy font files to $JAVA_HOME/jre/lib/fonts/.


Yegor

> Hi List,
> 
>  
> 
> I am using an HSSFWorkbook and writing data with different cell styles
> to it. Once all the data is written and necessary styles applied, I
call
> the autoSizeColumn((short)i) method on all the columns of the sheet to
> fit contents. This seems to work fine in my local app server, but when
> put it in a different server, the columns don't auto-fit. The cells
show
> ###### instead of the data. I have to resize the column header to see
> the data.
> 
>  
> 
> Not sure if there are some server settings that needs to be tweaked.
> 
>  
> 
> Thanks,
> 
> Dilip Maurya.
> 
> 


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


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


Re: Column auto size not working.

Posted by Yegor Kozlov <ye...@dinom.ru>.
autoSizeColumn uses Java2D to measure text. If some of the fonts are not available, JDK uses the default font and the 
result can be "off".

If any fonts are missing in production you need to install them and
  copy font files to $JAVA_HOME/jre/lib/fonts/.


Yegor

> Hi List,
> 
>  
> 
> I am using an HSSFWorkbook and writing data with different cell styles
> to it. Once all the data is written and necessary styles applied, I call
> the autoSizeColumn((short)i) method on all the columns of the sheet to
> fit contents. This seems to work fine in my local app server, but when
> put it in a different server, the columns don't auto-fit. The cells show
> ###### instead of the data. I have to resize the column header to see
> the data.
> 
>  
> 
> Not sure if there are some server settings that needs to be tweaked.
> 
>  
> 
> Thanks,
> 
> Dilip Maurya.
> 
> 


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