[reportlab-users] tables in tables.....in tables

Robin Becker reportlab-users@reportlab.com
Wed, 29 Oct 2003 09:02:04 +0000


In article <3F9F755B.9040807@sjsoft.com>, Shayan Raghavjee
<shayanr@sjsoft.com> writes
......
>          tCol1List = [tBlock1, tBlock2]
>          subTable1 = Table(tCol1List, style=LargeTableStyle(), 
>repeatRows = 0)
>          tCol2List = [tBlock3, tBlock4, tBlock5, tBlock6]
>          subTable2 = Table(tCol2List, style=LargeTableStyle(), 
>repeatRows = 0)
>          dataTableList = [subTable1, subTable2]
>          dataTable = Table(dataTableList, style=LargeTableStyle(), 
>repeatRows = 0)
>
>where the tBlock variables are already working tables (ie, they work on 
>their own). ie. I want 2 tables on one side, with 4 on the other, and 
>I've made 2 subtables so that the 'main' table only has 1 row with 2 
>columns.
>Is there anything wrong with that code? Does the table need to be 
>arranged in a ceratin way? Is the depth too much?
>

With so many unspecified tables it's hard to be sure where the error
comes from. Can you submit a small complete failing script with tBlock1,
tBlock2 filled in with some trivial data eg 'A', 'B', 'C' etc? That way
I can debug it. I suspect it's that the data isn't a list of lists.
If tBlock1/2 are themselves lists then this should work, but if they're
tables then the data just looks like

[1,2] and doesn't look like [[1,2]].

>I get the following error, if it helps:
>
>File "c:\Projects\jSuite.py\Falke\web\ticketweb.py", line 306, in 
>genTickets
>  subTable1 = Table(tCol1List, style=LargeTableStyle(), repeatRows = 0)
>
>File "C:\Python22\reportlab\platypus\tables.py", line 148, in __init__
>  if len(data[i]) != ncols:
>
>
>
>AttributeError: Table instance has no attribute '__len__'
>
>
>Againj, thanks for any help.
>
>Shayan Raghavjee,
>St. James Software
>
>_______________________________________________
>reportlab-users mailing list
>reportlab-users@reportlab.com
>http://two.pairlist.net/mailman/listinfo/reportlab-users
>

-- 
Robin Becker