You are viewing a plain text version of this content. The canonical link for it is here.
Posted to user@poi.apache.org by Marty Phee <mp...@jump-technologies.com> on 2005/03/03 15:37:49 UTC

setColumnWidth question

Dumb question.  This line is from the examples.  I'm trying to figure 
out the best way to set column widths.  What exaclty does the equation 
below mean and how does it relate to the string that is in the column?

c.setCellValue( "Use \n with word wrap on to create a new line" );
s.setColumnWidth( (short) 2, (short) ( ( 50 * 8 ) / ( (double) 1 / 20 ) ) );

The doc's say units of 1/256 of a font width.

---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/


Re: setColumnWidth question

Posted by an...@superlinksoftware.com.
Yeah that doc comes from the Excel 97 Dev kit.  Its totally bogus.  We
have no idea what the column width really means so all advice and goofy
equations are just "this usually works" guesses.

Marty Phee wrote:

> Dumb question.  This line is from the examples.  I'm trying to figure 
> out the best way to set column widths.  What exaclty does the equation 
> below mean and how does it relate to the string that is in the column?
>
> c.setCellValue( "Use \n with word wrap on to create a new line" );
> s.setColumnWidth( (short) 2, (short) ( ( 50 * 8 ) / ( (double) 1 / 20 
> ) ) );
>
> The doc's say units of 1/256 of a font width.
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
> Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
> The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/
>



---------------------------------------------------------------------
To unsubscribe, e-mail: poi-user-unsubscribe@jakarta.apache.org
Mailing List:     http://jakarta.apache.org/site/mail2.html#poi
The Apache Jakarta Poi Project:  http://jakarta.apache.org/poi/