[prev in list] [next in list] [prev in thread] [next in thread] 

List:       poi-user
Subject:    Re: Ouch - pictures + wrapping = stretched pictures
From:       Rob Y <ryampolsky () yahoo ! com>
Date:       2008-12-12 18:45:46
Message-ID: 20981309.post () talk ! nabble ! com
[Download RAW message or body]



Rob Y wrote:
> 
> I'm trying to put status flag pictures into XLS cells, and have it kind of
> working.  But there's a problem.  On certain columns, I have the cell
> wrapping attribute set.  So on the rows where there's enough text in those
> cells to actually wrap, my pictures get stretched to the cell height.
> 
> I could probably set the row height explicitly, but I think that would
> prevent Excel from automatically wrapping text.  It looks like a catch-22.
> 
> 

Tried explicitly setting the row height, and as I suspected, that fixes the
picture sizing, but it also prevents auto-wrapping from working (Excel
doesn't resize size the rows to fit the wrapping text, and you only end up
seeing the first line of the text).  If you then manually resize the row
you'll see all of the wrapping text, and the picture will not be stretched
(I use anchor type 2).  But that's a big pain.

What I don't get is that with anchor type 2, Excel maintains the original
size of the picture regardless of how you resize the anchor cell(s).  How
can it do that if the only sizing mechanism is the anchor itself, which is
relative to the cell(s)?  The only way I can think of (short of there being
another record type or option that POI doesn't support) is for Excel to
dynamically adjust all anchors whenever you resize a row (or column) that
could affect those anchors.

Never underestimate the horribleness of the XLS file format or the lengths
Microsoft will go to to hide that awfulness from you, but seriously.  Do we
really think Excel does all that on every resize operation?  And if they do
go through that, why don't they do it for auto-wrapping too?

In the case of auto-wrapping, I guess POI leaves the row height set at -1
(default) and excel replaces that with the results of auto-wrapping.  Any
anchors that include that default height row must have been set up with that
height in mind, so when Excel enlarges the row, it ought to fix the anchors
just like it does when you manually enlarge the row.  I just don't get it.
-- 
View this message in context: \
http://www.nabble.com/Ouch---pictures-%2B-wrapping-%3D-stretched-pictures-tp20964770p20981309.html
 Sent from the POI - User mailing list archive at Nabble.com.


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


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic