[reportlab-users] platypus and time consuming table flowable

Thomas Zehbe reportlab-users@reportlab.com
Wed, 27 Oct 2004 11:57:51 +0200


Hi all,
After producing some documents I just started to produce simple lists unsin=
g=20
the platypus engine. Thes are the essential lines of code:
=2E..
class ListDocTemplate(BaseDocTemplate):
    _invalidInitArgs =3D ('pageTemplates',)

    def __init__(self, filename, **kw):
        frame =3D Frame(LM, BM, PW-LM-RM, PH-BM-TM, id=3D'F', leftPadding=
=3D0)
        #self.allowSplitting =3D 0
        apply(BaseDocTemplate.__init__, (self, filename), kw)
        template =3D PageTemplate('List', [frame], reportListPage)
        self.addPageTemplates(template)
        self.d =3D date.today()
        self.title =3D 'keine Titel'
=2E..
    for line in cs.fetchall():
        pos.append((lfdnr,line['artikelnr'],line['bezeichnung'], \
		line['masse'],=20
        line['mass'],line['vkpreis']))
=2E..
    t =3D Table(pos, (25,60,200,60,60,60))
    t.hAlign =3D 'LEFT'
    t.setStyle(tablestyle)
    Story.append(t)
    print d.today()
    try:
        doc.build(Story)=20
    except:
        print "Pfad nicht vorhanden"
        raise
=2E.
As one can see it=B4s very simple.
The problem is, that the "doc.build(Story)" statement time consumption grow=
s=20
exponetially with the number of lines:
line count		time / s	per line / s
100			0,45		0,00450
500			4,19		0,00838
1000		18,51	0,01851
2000			96,92	0,04846
3000			282,97	0,09432

IMHO this problem should be linear in the time domain with constant time=20
consumption per table line. So I believe that I=B4m doing something wrong. =
But=20
what? Any hints or ideas would be apreciated.
Thanks
=2D-=20
Thomas Zehbe

INGENION GmbH
Luther Weg 50
31515 Wunstorf

Tel 05031-902042
=46ax 05031-902049
www.ingenion.de