Account Options

  1. Sign in
The old Google Groups will be going away soon, but your browser is incompatible with the new version.
Google Groups Home
« Groups Home
Message from discussion Bug in row.height ?
The group you are posting to is a Usenet group. Messages posted to this group will make your email address visible to anyone on the Internet.
Your reply message has not been sent.
Your post was successful
 
From:
To:
Cc:
Followup To:
Add Cc | Add Followup-to | Edit Subject
Subject:
Validation:
For verification purposes please type the characters you see in the picture below or the numbers you hear by clicking the accessibility icon. Listen and type the numbers you hear
 
John Yeung  
View profile  
 More options Dec 30 2009, 9:00 pm
From: John Yeung <gallium.arsen...@gmail.com>
Date: Wed, 30 Dec 2009 21:00:53 -0500
Local: Wed, Dec 30 2009 9:00 pm
Subject: Re: [pyxl] Bug in row.height ?
If only I had read this more carefully when I first opened it, I could
have saved myself hours of painful BIFF-documentation-reading and
bit-by-bit (byte-reversed!) file inspection.  (More comments below.)

On Mon, Dec 28, 2009 at 6:18 PM, John Machin <sjmac...@lexicon.net> wrote:
> Assuming hidden=0, collapsed=0, has_default_height=0, as far as I can
> tell the following rules are applied:

> A. If height_mismatch is true, Excel will use the requested height. In
> other words, font doesn't match requested height, so go with the
> requested height. If the font is small, you get space. If the font is
> large, you get chopped characters.

> B. Else: (1) Excel will calculate a row height high enough to accomodate
> the tallest font used in the row. (2) If any cell in the row is styled
> with "alignment: wrap on" and the text is too long to fit in the column
> width, Excel will calculate a row height sufficient to accomodate
> wrapping all such cells within their column width.

Given behavior A (which I independently discovered through much effort
earlier today), I suggest the "tutorial" (de facto manual, available
at python-excel.org as python-excel.pdf) be updated, because it
currently says

"Do not be fooled by the height attribute of the Row class, it does
nothing.  Specify a style on the row and set its font height attribute
instead."

The height attribute certainly does more than nothing when combined
with height_mismatch.  The font-based solution has its merits, but
isn't a perfect substitute for being able to pick a specific row
height.

As a vague idea (weaker than a suggestion), it might be easier, or at
least less cryptic, to add a Row.set_height method and point people to
it in the tutorial, than to explain in the tutorial that they have to
set both height and height_mismatch.

Oh, it might be useful to mention that the reason I was investigating
setting the row height in the first place was because I couldn't coax
Excel into doing automatic height adjustment to accommodate wrapped
text in merged cells.  (As far as I can tell, this is a bug in Excel
2000 and doesn't imply any deficiency in xlwt.)

John Y.


 
You must Sign in before you can post messages.
To post a message you must first join this group.
Please update your nickname on the subscription settings page before posting.
You do not have the permission required to post.