Re: Question on merged cell writing (xlwt)

3,711 views
Skip to first unread message

Chris Withers

unread,
Aug 18, 2009, 8:45:43 AM8/18/09
to Wolfgang Belau, python...@googlegroups.com
Hi Wolfgang,

It's always best to take these kind of questions to the python-excel
google group. I've cc'ed the group in, for more information, see
http://www.python-excel.org...

Wolfgang Belau wrote:
>
> I am wondering about the semantics about :
> ws.write_merge(a,b,c,d,'some text', somestyle).
>
> Is (a,b) the start position for merge?

No.

> Does it merge cows or colums?

It merges a rectangular area, but the arguments are in a stupid order,
from Worksheet.py:

def write_merge(self, r1, r2, c1, c2, label="",
style=Style.default_style):

> I got unexpected results when trying to merge cells in a single row.

Hopefully you can tell us what you were expecting and what you observed?

Chris

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

John Machin

unread,
Aug 18, 2009, 9:30:55 AM8/18/09
to python...@googlegroups.com, Wolfgang Belau
On 18/08/2009 10:45 PM, Chris Withers wrote:
> Hi Wolfgang,

> Wolfgang Belau wrote:
>> I am wondering about the semantics about :
>> ws.write_merge(a,b,c,d,'some text', somestyle).
>>
>> Is (a,b) the start position for merge?
>
> No.
>
>> Does it merge cows or colums?
>
> It merges a rectangular area, but the arguments are in a stupid order,
> from Worksheet.py:
>
> def write_merge(self, r1, r2, c1, c2, label="",
> style=Style.default_style):

Using keyword args, one may impose one's own order, e.g.:

sheet.write_merge(r1=0, c1=0, r2=3, c2=9, label="sample merge")

>> I got unexpected results when trying to merge cells in a single row.

Consider running the relevant examples in the xlwt/examples directory
and inspecting the output with Excel/OOo Calc/Gnumeric.

>
> Hopefully you can tell us what you were expecting and what you observed?

AND the code you used to create the observable(s) ...

What versions of Python and xlwt you are using could be helpful too.

Cheers,
John

Reply all
Reply to author
Forward
0 new messages