[reportlab-users] Table, SPAN and splitlast

rj-reportlab at arsynet.com rj-reportlab at arsynet.com
Thu Jan 17 09:53:40 EST 2008


le 16.01.2008 19:10 Tim Roberts a écrit:

> 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))

>

Same error with this syntax. :-(

When I first tried with ('SPAN', (0, 'splitlast'), (-1, 'splitlast')) it
was done after an example found in the distribution :
reportlab/test/test_platypus_tables.py
where you can find : ('LINEBELOW', (0,'splitlast'),
(-1,'splitlast'), 1, colors.white,'butt')



More information about the reportlab-users mailing list