[reportlab-users] simple tables example

Jean-Francois Gosset jfg at netinfo.fr
Sun Dec 19 11:57:10 EST 2004


Message d'origine (19:20 19/12/2004 +1000) :

>ok an update
>
>i found a small example but now i get this
>
>File "/usr/home/timothy/Projects/PubWare/python/WeeklyReportPDF.py", line 29, in MakeReport
>   t = Table(WeeklyReport, rowheight, colwidth)
> File "/usr/local/lib/python2.3/site-packages/reportlab/platypus/tables.py", line 149, in __init__
>   elif len(colWidths) != ncols:
>TypeError: len() of unsized object
>
>here is my code
>
>doc = SimpleDocTemplate('tmp.pdf')
>  
>   WeeklyReport = ('test','test','test')
> 
>   rowheight=(10)

Python error : this doesn't give a tuple but just the integer 10.

For a one element tuple, use: (10,)

>   colwidth = (16,16,16)
>   t = Table(WeeklyReport, rowheight, colwidth)
>   doc.build(t)
>



More information about the reportlab-users mailing list