[reportlab-users] Report lab tables

Johan Paul Glutting reportlab-users@reportlab.com
Mon, 04 Oct 2004 08:26:15 +0200


There is a typo here (not sure if it got in while you were passing it to 
email). There is an extra close-parenthesis after  (1,2,3)

The data that goes into a table must be a a sequence of sequences - the 
outer sequence is usually a list, but I don't know if that is absolutely 
mandatory (I have not gotten all the way through your example yet). I do 
know that you can have a list as the inner sequence (I convert them to 
lists frequently so that I can manipulate the results as text - insert 
thousands commas, convert nulls to "--", etc.)

More later ...

JP


En/na Tim Smith ha escrit:

> hello there i have been attempting to make reportlab produce tables 
> and i've run into a snag, below is my code, without any real 
> documentation i can only go by the examples,  my code below errors can 
> anyone explain why?
>
> from reportlab.platypus import SimpleDocTemplate, Paragraph, Spacer, 
> Table
> from reportlab.lib.styles import getSampleStyleSheet
> from reportlab.rl_config import defaultPageSize
> from reportlab.lib.units import inch
> import time
>
> def tbl():
>    t = Table(
>        (('test','test2','test3'),
>        (1,2,3)),
>        (72,36,36),
>        (24,16,16)
>         )
>
>    return t
>
> def genPDF():
>
>    InvoiceNum = time.strftime('%Y%m%d%H%S')
>    doc = SimpleDocTemplate(InvoiceNum+'.pdf')
>    t = tbl()
>    Invoice = []
>
>    Invoice.append(t)
>        doc.build(Invoice)
> _______________________________________________
> reportlab-users mailing list
> reportlab-users@reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users



-- 
JP Glutting
Oficina de Qualitat		Plaša VÝctor Siurana, 1
Universitat de Lleida		25003 Lleida
-------------------------------------------------------
Tel: 973 703 103		Fax: 973 702 036