[reportlab-users] Table, SPAN and splitlast

Tim Roberts timr at probo.com
Wed Jan 16 13:10:00 EST 2008


rj-reportlab at arsynet.com wrote:

> Hello,

>

> I'm new to Reportlab and I tried a draw a simple table with 3 columns

> and I want the last row to be SPANned over the 3 cols.

> So I first added ('SPAN', (-1, 0), (-1,-1)) to the table style, but I

> discovered that if the table was split over multiple pages, the last

> row of each page was spanned...

> After looking in the manuals I found that I could use 'splitlast' so I

> changed the style to

> ('SPAN', (0, 'splitlast'), (-1, 'splitlast')) and got an error whose

> traceback ends with

> ...

> File "C:\Python24\lib\site-packages\reportlab\platypus\tables.py",

> line 763, in _calcSpanRanges

> for y in xrange(y0, y1+1):

> TypeError: cannot concatenate 'str' and 'int' objects

>

> Can you help me with that ?


Read the doc: "In any style command the first row index may be set to
one of the special strings 'splitlast' or 'splitfirst' ..."

You're setting BOTH the first and second row indices to 'splitlast'. I
believe you want this:
('SPAN', (0,'splitlast'), (-1,-1))

--
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list