[reportlab-users] How do I use Platypus in forms?

Shayan Raghavjee reportlab-users@reportlab.com
Fri, 02 Jan 2004 11:51:09 +0200


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

Is that right? I originally wanted to build a seperate SimpleDocTemplate 
and add it to doc, rather than build a new one, but I don't know how to.

I get:

File "C:\Python22\reportlab\pdfgen\canvas.py", line 658, in endForm
    (name, lowerx, lowery, upperx, uppery) = self._formData

TypeError: unpack non-sequence

when I try to run the code above.