pyExcelerator number formats and borders (was Re: PyExcerlerator details)

John Machin sjmachin at lexicon.net
Tue Apr 29 23:14:02 CEST 2008


A_H wrote:
> Hi, I'm using PyExcelerator, and it's great,

If you are using the latest released version, it's not, IMO. Reading the 
fixed-later bug reports on Sourceforge may prompt you to get the latest 
version from svn. Reading the unfixed bug reports on Sourceforge may 
prompt you to switch to xlwt (i.e. "Excel write"), a fork of 
pyExcelerator (fixed known and unknown bugs, improved performance, and 
runs under Python 2.3) -- available from
https://secure.simplistix.co.uk/svn/xlwt/trunk

See also http://groups.google.com/group/python-excel [to which I've CCed 
this reply].

> but I can't figure out a
> few things:
> 
> 
> (1)  I set the cell style to '0.00%' but the style does not work.

That isn't a style, it's a "number format". See num_formats.py in the 
examples directory.

> 
> (2)  I want to place a border around the cells( x1, y1, x2, y2 ) but I
> can't find any example of doing that.
> Well I do see ONE example, but it erases the cells if I do it after,
> or when I write to the cells that erases the outline.

At the moment, neither pyExcelerator nor xlwt offer a style-setting 
facility that's independent of the Worksheet.write method. It could well 
be a useful enhancement.

> Surely I don't have to tediously set each cells border?

Perhaps you could suggest what you think the API for setting a border on 
a rectangle should be.

Each cell's border has to be set somehow. With a style_setting approach, 
there are 8 different cases (4 sides and 4 corners). With an independent 
border-setting approach, there would be only 4 different cases (4 sides) 
... this needs looking at to see how easily the existing data model 
would support it.

Regards,
John



More information about the Python-list mailing list