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

Shayan Raghavjee reportlab-users@reportlab.com
Sun, 04 Jan 2004 16:53:25 +0200


Oopsie, posted this to the wrong place initially.

Err, I'm pretty sure I'm right. You can't render a Table object on it's 
own, I think? It's not 3 dimensional anyway, it's a list with one Table 
object. I could be wrong though.

doc.build([table]) is effectively:
Story = []
Story.append(table)
doc.build(Story)

beginForm & endForm create a form element, which can be inserted 
anywhere in the object. Apparently it's supposed to speed things up. 
Still haven't got it to work.

Dick Kniep wrote:

> 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.
>
>  
>