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
XLWT/Surpass
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
  1 message - 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
 
Ana Nelson  
View profile  
 More options Mar 12 2009, 7:56 am
From: Ana Nelson <nelson....@gmail.com>
Date: Thu, 12 Mar 2009 04:56:19 -0700 (PDT)
Local: Thurs, Mar 12 2009 7:56 am
Subject: XLWT/Surpass
First of all, thanks to everyone in Python Ireland for their
hospitality. :-)

I was asked last night for a specific example of something I had
changed to be more Rubyish. Probably the best example of this would be
the changes I made to the StyleFormat class.

In Surpass, you can set up a new StyleFormat by passing a hash of
format parameters to StyleFormat.new:

    date_format = StyleFormat.new(:number_format_string => 'D-MMM-YY')
    header_format = StyleFormat.new(:font_bold => true, :font_height
=> 230)

Then to use these style formats you would write to your worksheet like
this:

book = Workbook.new("style_formats.xls")
sheet = book.add_sheet
sheet.write(0, 0, "This is a date:", header_format)
sheet.write(1, 0, Date.new(2009, 1, 1), date_format)
book.save

The original way to accomplish this would be to set each attribute
individually, like so (in Python):

font0 = Font()
font0.height = 230
font0.bold = True

style0 = XFStyle()
style0.font = font0

Note that you can set individual attributes like this in Surpass
(Ruby) as well, but using a hash for initialization is a nice
shortcut.

I'll get my slides up ASAP.


 
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 »