[reportlab-users] simple tables example

Timothy Smith timothy at open-networks.net
Sun Dec 19 04:20:19 EST 2004


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)
    colwidth = (16,16,16)
    t = Table(WeeklyReport, rowheight, colwidth)
    doc.build(t)


Timothy Smith wrote:

> i'm trying to follow the tables example in the user guide, but it's 
> very, very terse. the table.py example of the other hand is way too 
> indepth
>
> why do i get this error?
>
>
>   doc = SimpleDocTemplate('tmp.pdf')
>      WeeklyReport = ['test','test','test']
>          t = Table(WeeklyReport)
>      doc.build(t)
>
> File 
> "/usr/local/lib/python2.3/site-packages/reportlab/platypus/tables.py", 
> line 156, in __init__
>    raise ValueError, "%s not enough data points in row %d!" % 
> (self.identity(),i)
>  File 
> "/usr/local/lib/python2.3/site-packages/reportlab/platypus/tables.py", 
> line 192, in identity
>    cv = self._cellvalues
> AttributeError: Table instance has no attribute '_cellvalues'
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
>



More information about the reportlab-users mailing list