I've worked on this before and what it boils down to is the fact that the
width in the file is defined as a character width (or something like that).
So if you change fonts, size, etc the calculation is different (and it is
not linear from any tests I've done).  Basically, it boils down to coming up
with a conversion for this width to set things nicely. 

Yeah, it would be very related to if something wraps.

-----Original Message-----
From: Charlat, Simon (Exchange) [mailto:[EMAIL PROTECTED]]
Sent: Wednesday, December 18, 2002 10:20 AM
To: 'POI Users List'
Subject: RE: Autofit


I know it is not a property.
I need it on the column, but in excel you need to define the range of cells
or the columns.
Do you have a suggestion?
It looks like this in Excel VB script: 
Worksheets("Sheet1").Columns("A:A").EntireColumn.AutoFit (for column level)
or Worksheets("Sheet1").Range("A1:E4").Columns.AutoFit (for row and column)



Thank you,
Simon Charlat
ITG - Mutual Funds
973-793-7506
Bearnet 8-226-7506
Fax 973-793-7389

 -----Original Message-----
From:   Laubach Shawn Contr OC-ALC/PSB [mailto:[EMAIL PROTECTED]] 
Sent:   Wednesday, December 18, 2002 10:43 AM
To:     'POI Users List'
Subject:        RE: Autofit

Are you talking about autofit under row and column of formats?  If so,
that's not a property, it's an action.  Nothing is saved and nothing
autofits again unless you select again.

Shawn

-----Original Message-----
From: Andrew C. Oliver [mailto:[EMAIL PROTECTED]]
Sent: Tuesday, December 17, 2002 1:38 PM
To: POI Users List
Subject: Re: Autofit


First, Grab a copy of the Excel 97 Developers' kit from amazon.com ( out 
of print but ~$15(US) used or from surplus sellers).  This documents the 
format.

Create a blank sheet with text in the upper right hand cell (or some 
other cell)
save it
copy it to another file as well
open it
assign the autofit property

java org.apache.poi.hssf.dev.BiffViewer noautofit.xml > output.1
java org.apache.poi.hssf.dev.BiffViewer yesautofit.xml > output.2
diff output.1 output.2

That gives you the differences between an autofitted cell and a non 
autofitted cell.  You merely need to interperate them (using the book) 
and make the appropriate changes to HSSF.  (should be simple). 
 Shouldn't take long once you get the source material.

We should move this conversation to poi-dev.

-Andy

Charlat, Simon (Exchange) wrote:

>Let me know what needs to be done.
>I need to estimate it for the users and maybe they will pay for my time to
>do this.
>I defaulted all the cells width to the longest data value.
>It doesn't look good.
>
> -----Original Message-----
>From:  Andrew C. Oliver [mailto:[EMAIL PROTECTED]] 
>Sent:  Tuesday, December 17, 2002 12:54 PM
>To:    [EMAIL PROTECTED]
>Subject:       Re: Autofit
>
>No thats not it.  Autofit is a seperate issue.  Just we have like 4 
>people actively working on HSSF and they are all working on other things 
>at current.  Autofit is just a style issue (you say "yes autofit this 
>cell").  If someone would like to volunteer to implement it, I can 
>explain how.  I just don't have time to do it currently.
>
>-Andy
>
>Brian Glick wrote:
>  
>
>>There has been frequent discussion on this list about implementing an
>>Autofit feature, but, thus far, it has not been done.  So far, no one
>>    
>>
>seems
>  
>
>>to have come up with a foolproof formula for calculating the appropriate
>>widths.
>>
>>Brian Glick
>>Freightek, Inc.
>>(215) 887-6100
>>[EMAIL PROTECTED]
>>
>>-----Original Message-----
>>From: Charlat, Simon (Exchange) [mailto:[EMAIL PROTECTED]] 
>>Sent: Tuesday, December 17, 2002 10:30 AM
>>To: 'POI Users List'
>>Subject: RE: Autofit
>>
>>I went through all the docs and I didn't find anything besides
>>setDefaultColumnWidth or setColumnWidth.
>>That's what you refering to?
>>I am using it already and I am not happy with it.
>>I have to calculate the width and it is not perfect.
>>Can I use anything else?
>>
>>
>>Thank you,
>>Simon Charlat
>>ITG - Mutual Funds
>>973-793-7506
>>Bearnet 8-226-7506
>>Fax 973-793-7389
>>
>> -----Original Message-----
>>From:         Vikas Pathak [mailto:[EMAIL PROTECTED]] 
>>Sent: Tuesday, December 17, 2002 5:42 AM
>>To:   POI Users List
>>Subject:      Re: Autofit
>>
>>Hi,
>>
>>Go to the Apache Excel Sheet docs for POI.U will get the FUll API for the
>>HSSF -POI docs.
>>If any clarification please let me nkow.
>>Thanks & regards
>>Kalpana Kanniappan
>>
>>"Charlat, Simon (Exchange)" wrote:
>>
>>    
>>
>>>I need to execute Autofit command on excel file created using HSSF.
>>>I could not find any reference in HSSF support document.
>>>Please, help.
>>>
>>>Thank you,
>>>Simon
>>>
>>>****************************************************************
>>>Bear Stearns is not responsible for any recommendation, solicitation,
>>>offer or agreement or any information about any transaction, customer
>>>account or account activity contained in this communication.
>>>***********************************************************************
>>>
>>>--
>>>To unsubscribe, e-mail:
<mailto:[EMAIL PROTECTED]>
>>>For additional commands, e-mail:
<mailto:[EMAIL PROTECTED]>
>>>      
>>>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>
>>
>>****************************************************************
>>Bear Stearns is not responsible for any recommendation, solicitation, 
>>offer or agreement or any information about any transaction, customer 
>>account or account activity contained in this communication.
>>***********************************************************************
>>
>>
>>--
>>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>>    
>>
>
>
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>****************************************************************
>Bear Stearns is not responsible for any recommendation, solicitation, 
>offer or agreement or any information about any transaction, customer 
>account or account activity contained in this communication.
>***********************************************************************
>
>
>--
>To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
>For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>
>
>
>  
>




--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>


***********************************************************************
Bear Stearns is not responsible for any recommendation, solicitation, 
offer or agreement or any information about any transaction, customer 
account or account activity contained in this communication.
***********************************************************************


--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

--
To unsubscribe, e-mail:   <mailto:[EMAIL PROTECTED]>
For additional commands, e-mail: <mailto:[EMAIL PROTECTED]>

Reply via email to