[reportlab-users] How do I use Platypus in forms?
Dick Kniep
reportlab-users@reportlab.com
Fri, 2 Jan 2004 18:30:46 +0100
On Friday 02 January 2004 10:51, Shayan Raghavjee schreef:
> Hi
>
> I've been having trouble getting these to work. I've been able to get it
> working when drawing directly onto the canvas, but I'm getting errors
> when I try to render Platypus objects into a form structure.
>
> Basically I'm doing something like:
> def detailForm(doc): #doc = Reportlab SimpleDocTemplate
>
> doc.canv.beginform('sample')
> tabledata = [[1,2,3,4,5,6],[6,5,4,3,2,1]]
> table = Table(tabledata)
> doc.build([table])
> doc.canv.endForm()
> return doc
I notice that you have the table in 3 dimensions instead of in 2. This will
cause the problem. Try:
doc.build(table)
Furthermore, I never used beginform and endform, and I do not know what they
are doing.
--
Cheers,
D.J. Kniep
Lindix BV
Tel. 036-5215580
PS.
Happy new year to all of you, and I hope you all keep up the good work!!!