[reportlab-users] Reportlab examples

Tim Roberts timr at probo.com
Tue Jul 26 13:55:35 EDT 2005


On Tue, 26 Jul 2005 13:34:55 +0200 (CEST), Nicholas Wieland 
<nicholas_wieland at yahoo.it> wrote:

>Hi *, I know that ReportLab comes with a lot of good documentation, so asking for examples may seem a little weird :)
>I'm looking for examples that subclass DocTemplate or Table, or generally use ReportLab in a more OO way, for example inside a Python framework.
>I have to produce some big pdfs inside a Zope product, so I'd like to wrap all that's PDF-related inside a subsystem to call and use to keep my code readable, but actually I'm a little confused because there's so many things to know :)
>  
>

This is actually a very interesting topic for a philosophical debate.  I 
don't have the answers, but perhaps we can share some war stories.

Making something more "OO" generally involves coming up with an 
appropriate abstraction: figuring out what the objects are and what 
behaviors they need to have.  In my mind, I view my ReportLab canvas as 
the object that owns the rendering.  When I'm doing a report, there's 
generally just a function somewhere called "renderReport" that loops 
through the data to create the tables.  Sometimes, that will break down 
into "renderFront" and "renderBack" or "renderLeftPane" and 
"renderRightPane", etc., but I don't generally think about having each 
row having the ability to render itself, for example.

Certainly there are datasets where this makes sense, of course, and I'd 
be interested to hear how others have approached this, and whether those 
approaches worked for you.

-- 
Tim Roberts, timr at probo.com
Providenza & Boekelheide, Inc.



More information about the reportlab-users mailing list