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 Machin  
View profile  
 More options Dec 28 2009, 6:18 pm
From: John Machin <sjmac...@lexicon.net>
Date: Tue, 29 Dec 2009 10:18:48 +1100
Local: Mon, Dec 28 2009 6:18 pm
Subject: Re: [pyxl] Bug in row.height ?
On 29/12/2009 7:28 AM, ShadowHywind wrote:

> When ever i try to change the height of row 0 it never works. I am
> using worksheet.row(0).height = 600
> and the row stays the same. However if i try changing any other row it
> works. Any thoughts?

1. If you doing EXACTLY the same to row 0 and "any other row", and one
works and the the other doesn't, that's a bug. Please post a minimal
script that demonstrates this problem.

2. Have you read the tutorial available from http://www.python-excel.org/ ?

3. Here are the results of some experiments I did earlier this year:

"""
xlwt just sets attributes in the Row objects and hopes for the best.
There is no if/but/maybe/default/override behaviour at all.

Relevant attributes are:
height -- default is 255 twips [Remember: 20 twips per point, 72 points
per inch, 25.4 mm per inch]
has_default_height -- boolean
height_mismatch -- boolean

has_default_height is probably only useful if a row is hidden and/or
collapsed [which I haven't explored]. I think it means this: when the
row is unhidden/uncollapsed, restore its visible height to
    (row.height if row.has_default_height else "some calculated or
global-default value")

has_default_height is definitely NOT A GOOD IDEA otherwise. If
has_default_height and height_mismatch are both true, Excel goes off the
planet (row height in excess of window height, need magn=25% to see
what's happening!!).

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.

If you save the file with Excel, it will set the Row.height to the value
that it actually used (requested for rule A, calculated for rule B).
"""

I have uploaded a script (row_height_options.py) to the group's file
section. It demonstrates most of the above.

Cheers,
John


 
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.