[reportlab-users] Report lab tables

Tim Smith reportlab-users@reportlab.com
Mon, 04 Oct 2004 16:33:56 +1000


yes i kow embaressing mistake there i found it myself a while ago. i 
have another question now but, picures how do i load them? eg, jpg's?
i was doign it just fine with the canvas object, how do i organise them 
with platypus?

Johan Paul Glutting wrote:

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