[reportlab-users] Table not drawn
Simone Dalmasso
simone.dalmasso at gmail.com
Tue Jun 9 08:07:31 EDT 2009
Yes! It works! Thanks a lot.
Simone
2009/6/9 Robin Becker <robin at reportlab.com>
> Matt Folwell wrote:
>
>> Robin Becker wrote:
>>
>>> Simone Dalmasso wrote:
>>>
>>>> Hi list, I'm trying to draw a table on a document. This is part of my
>>>> code:
>>>> * canv = canvas.Canvas(response,pagesize = A4)*
>>>> * data = [['Hello'],['World']]
>>>> t = Table(data,10 * cm,5 * cm)
>>>> w,h = t.wrap(10 * cm,5 * cm)
>>>> t.drawOn(canv,A4[0],A4[1])
>>>> canv.showPage()
>>>> canv.save()*
>>>> The document is created but unfortunately it's empty. Using a simple
>>>> string
>>>> instead of a table it works.
>>>> Have you any advices?
>>>>
>>>> Thanks a lot.
>>>> Simone
>>>>
>>> ........
>>>
>>> Tables are supposed to be drawn in a flowable environment so they're
>>> drawn top leftish if you get what I mean. I suspect you need to change to
>>>
>>> t.drawOn(canv,A4[0],A4[1]-h)
>>>
>>>
>> Surely it's
>>
>> t.drawOn(canv,0,A4[1]-h)
>>
>> to make the table appear in the top-left corner of the page.
>>
>> The coordinates passed to Flowable.drawOn() are for the bottom-left corner
>> of where it should draw itself.
>>
>> yes I think you're right.
> --
> Robin Becker
>
> _______________________________________________
> reportlab-users mailing list
> reportlab-users at reportlab.com
> http://two.pairlist.net/mailman/listinfo/reportlab-users
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://two.pairlist.net/pipermail/reportlab-users/attachments/20090609/1082038f/attachment.html>
More information about the reportlab-users
mailing list