Gmail Calendar Documents Reader Web more »
Recently Visited Groups | Help | Sign in
Google Groups Home
Outline collapse
There are currently too many topics in this group that display first. To make this topic appear first, remove this option from another topic.
There was an error processing your request. Please try again.
flag
  6 messages - Collapse all  -  Translate all to Translated (View all originals)
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
 
Colin  
View profile  
 More options Oct 21, 2:00 am
From: Colin <rieger1...@gmail.com>
Date: Tue, 20 Oct 2009 09:00:18 -0700 (PDT)
Local: Wed, Oct 21 2009 2:00 am
Subject: Outline collapse
Hi guys,

I have a 3 level outline and I'd like to have all 2nd level groupings
collapsed by default. The private 'collapse' variable gave me hope
initially but after trying various things to set it, I haven't had
much luck. Is there any way to get around this?

Thanks


    Reply    Reply to author    Forward  
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.
Chris Withers  
View profile  
 More options Oct 21, 2:37 am
From: Chris Withers <ch...@simplistix.co.uk>
Date: Tue, 20 Oct 2009 17:37:24 +0100
Local: Wed, Oct 21 2009 2:37 am
Subject: Re: [pyxl] Outline collapse

Colin wrote:
> I have a 3 level outline and I'd like to have all 2nd level groupings
> collapsed by default. The private 'collapse' variable gave me hope
> initially but after trying various things to set it, I haven't had
> much luck. Is there any way to get around this?

I haven't had any problems with this. Can you provide a small code
example that shows the behaviour you're unhappy with?

cheers,

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk


    Reply    Reply to author    Forward  
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.
Colin  
View profile  
 More options Oct 21, 3:07 am
From: Colin <rieger1...@gmail.com>
Date: Tue, 20 Oct 2009 10:07:46 -0700 (PDT)
Local: Wed, Oct 21 2009 3:07 am
Subject: Re: Outline collapse
On Oct 20, 10:37 am, Chris Withers <ch...@simplistix.co.uk> wrote:

from xlwt import Workbook, Alignment, XFStyle
book = Workbook()
sheet = book.add_sheet('test')
alignRight = XFStyle()
align = Alignment()

alignRight = XFStyle()
align = Alignment()
align.horz = Alignment.HORZ_RIGHT
align.vert = Alignment.VERT_BOTTOM
alignRight.alignment = align

money = XFStyle()
money.num_format_str = '"$"#,##0.00_);("$"#,##'

rowID = 0
sheet.write(rowID, 1, 'Item')
sheet.write(rowID, 2, 'Date', alignRight)
sheet.write(rowID, 3, 'ID', alignRight)
sheet.write(rowID, 4, 'EP', alignRight)
sheet.write(rowID, 5, 'Boost', alignRight)
sheet.write(rowID, 6, 'Value', alignRight)
sheet.write(rowID, 7, '#', alignRight)
sheet.write(rowID, 8, 'Avg', alignRight)
sheet.write(rowID, 9, 'Max', alignRight)

for prod in ['prod1', 'prod2', 'Other']:
    rowID += 1
    sheet.write(rowID, 0, prod)
    for item in ['item1', 'item2', 'item3', 'item4']:
        rowID += 1
        sheet.write(rowID, 1, item)
        sheet.write(rowID, 7, 10 * rowID)
        sheet.write(rowID, 8, 1.00 * rowID, money)
        sheet.write(rowID, 9, 2.00 * rowID, money)
        sheet.row(rowID).level = 1
        for txn in ['txn1', 'txn2', 'txn3', 'txn4']:
            rowID += 1
            sheet.write(rowID, 2, 'date', alignRight)
            sheet.write(rowID, 3, txn)
            sheet.write(rowID, 4, 5)
            sheet.write(rowID, 5, 2)
            sheet.write(rowID, 6, 2.00 * rowID, money)
            sheet.row(rowID).level = 2
book.save('test.xls')

Would like all the items to be collapsed initially, hiding all of
their grouped transactions.


    Reply    Reply to author    Forward  
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.
Colin  
View profile  
 More options Oct 21, 6:29 am
From: Colin <rieger1...@gmail.com>
Date: Tue, 20 Oct 2009 13:29:08 -0700 (PDT)
Local: Wed, Oct 21 2009 6:29 am
Subject: Re: Outline collapse

On Oct 20, 11:07 am, Colin <rieger1...@gmail.com> wrote:

I may have been unclear. My question is.. how do I go about collapsing
a group outline? Is it even possible?

    Reply    Reply to author    Forward  
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.
Chris Withers  
View profile  
 More options Oct 28, 3:01 am
From: Chris Withers <ch...@simplistix.co.uk>
Date: Tue, 27 Oct 2009 16:01:06 +0000
Local: Wed, Oct 28 2009 3:01 am
Subject: Re: [pyxl] Re: Outline collapse

Colin wrote:

>> Would like all the items to be collapsed initially, hiding all of
>> their grouped transactions.

> I may have been unclear. My question is.. how do I go about collapsing
> a group outline? Is it even possible?

Hmm, I would have guessed that the .collapse attribute of the relevant
rows would need to be set to 1. However, I just tried that and it had no
effect.

I wonder if John can enlighten both of us?

Chris

--
Simplistix - Content Management, Batch Processing & Python Consulting
            - http://www.simplistix.co.uk


    Reply    Reply to author    Forward  
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.
John Machin  
View profile  
 More options Oct 28, 11:14 pm
From: John Machin <sjmac...@lexicon.net>
Date: Wed, 28 Oct 2009 23:14:07 +1100
Local: Wed, Oct 28 2009 11:14 pm
Subject: Re: [pyxl] Re: Outline collapse
On 28/10/2009 3:01 AM, Chris Withers wrote:

> Colin wrote:
>>> Would like all the items to be collapsed initially, hiding all of
>>> their grouped transactions.
>> I may have been unclear. My question is.. how do I go about collapsing
>> a group outline? Is it even possible?

> Hmm, I would have guessed that the .collapse attribute of the relevant
> rows would need to be set to 1. However, I just tried that and it had no
> effect.

> I wonder if John can enlighten both of us?

The latest MS docs says this of the "collapse" bit: "A bit that
specifies whether the rows that are one level of outlining deeper that
the current row are included in the collapsed outline state".

OOo docs: "1 = Outline group starts or ends here (depending on where
the outline buttons are located, see SHEETPR record,
➜5.97), /and/ is collapsed"

How's that for enlightenment? Not much?

A bit of gnireenigne esrever reveals that manually collapsed rows also
have the "hidden" bit set.

Something like this should do what Colin wants to do:

from xlwt import Workbook, Alignment, XFStyle

def set_row_data(row, level, collapse_level):
     row.level = level
     row.collapse = collapse_level == level + 1
     row.hidden = collapse_level < level + 1

book = Workbook()
alignRight = XFStyle()
align = Alignment()
alignRight = XFStyle()
align = Alignment()
align.horz = Alignment.HORZ_RIGHT
align.vert = Alignment.VERT_BOTTOM
alignRight.alignment = align
money = XFStyle()
money.num_format_str = '"$"#,##0.00_);("$"#,##'

for collapse_level in range(5):
     sheet = book.add_sheet('collapse%d' % collapse_level)
     rowID = 0
     sheet.write(rowID, 1, 'Item')
     sheet.write(rowID, 2, 'Date', alignRight)
     sheet.write(rowID, 3, 'ID', alignRight)
     sheet.write(rowID, 4, 'EP', alignRight)
     sheet.write(rowID, 5, 'Boost', alignRight)
     sheet.write(rowID, 6, 'Value', alignRight)
     sheet.write(rowID, 7, '#', alignRight)
     sheet.write(rowID, 8, 'Avg', alignRight)
     sheet.write(rowID, 9, 'Max', alignRight)
     for prod in ['prod1', 'prod2', 'Other']:
         rowID += 1
         sheet.write(rowID, 0, prod)
         set_row_data(sheet.row(rowID), level=0,
collapse_level=collapse_level)
         for item in ['item1', 'item2', 'item3', 'item4']:
             rowID += 1
             sheet.write(rowID, 1, item)
             sheet.write(rowID, 7, 10 * rowID)
             sheet.write(rowID, 8, 1.00 * rowID, money)
             sheet.write(rowID, 9, 2.00 * rowID, money)
             set_row_data(sheet.row(rowID), level=1,
collapse_level=collapse_level)
             for txn in ['txn1', 'txn2', 'txn3', 'txn4']:
                 rowID += 1
                 sheet.write(rowID, 2, 'date', alignRight)
                 sheet.write(rowID, 3, txn)
                 sheet.write(rowID, 4, 5)
                 sheet.write(rowID, 5, 2)
                 sheet.write(rowID, 6, 2.00 * rowID, money)
                 set_row_data(sheet.row(rowID), level=2,
collapse_level=collapse_level)
book.save('test.xls')

However, unless I'm seeing things, if you comment out the statement
setting row.collapse (i.e. using only row.hidden), the same effect is
obtained. Somebody needs to do some more experimentation ... I can't
spend any more time on it right now.

HTH,
John


    Reply    Reply to author    Forward  
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.
End of messages
« Back to Discussions « Newer topic     Older topic »

Create a group - Google Groups - Google Home - Terms of Service - Privacy Policy
©2009 Google