[reportlab-users] multipage table

Timothy Smith timothy at open-networks.net
Mon May 23 05:04:18 EDT 2005


Timothy Smith wrote:

> Robin Becker wrote:
>
>> Timothy Smith wrote:
>> ......
>>
>>>>
>>> i'm sorry ignore previous - i'm using 1.19
>>>
>>> i need to be able to generate a large table which spans 2 or more 
>>> pages, currently reportlab errors when attempting this.
>>> will i need to upgrade to achieve this?
>>> _______________________________________________
>>> reportlab-users mailing list
>>> reportlab-users at reportlab.com
>>> http://two.pairlist.net/mailman/listinfo/reportlab-users
>>>
>>>
>> is it impossible to upgrade? I haven't tried 1.19 for a while, but it 
>> was out a long time and we didn't get a huge rsponse about errors.
>>
>> If you can't upgrade, try the test_platypus_tables.py script and see 
>> if it gives you correctly split tables.
>
>
> test_platypus_tables.pdf that it generates is only a single page.
> it's not impossible to upgrade but i'd rather not rightnow if i can 
> help it. i'd preffer to just get it working
> _______________________________________________

heres my code anyway

doc = SimpleDocTemplate(PDFName)
ReportStyle = TableStyle([('GRID', (0,0),(-1,-1), 0.25, colors.black),
                                ('ALIGN',(0,0), (-1,-1), 'CENTRE'),
                                ('LEFTPADDING',(0,0),(-1,-1),4),
                                ('RIGHTPADDING',(0,0),(-1,-1),4),
                                ('FONT',(0,0),(-1,-1),'Times-Roman',8)])
        TopHeadingStyle = ParagraphStyle(name='TopHeadingStyle',
            fontName='Times-Roman',
            fontSize=14,
            alignment=TA_CENTER,
            spaceAfter=15)
           
        # add headings
        Report.append(Paragraph(ForVenue+ ' ' + str(Year) + ' Venue 
Inspection', TopHeadingStyle))
        Data.insert(0,['Week','Category','Item','Score'])   
       
        #items table       
        ItemsTable = Table(Data, None, None)
        ItemsTable.setStyle(ReportStyle)
        Report.append(ItemsTable)   
       
    doc.build(Report)


More information about the reportlab-users mailing list