Great!

I agree with your thoughts:

A. Setting width attributes in SQLTABLE is not a nice hack, having a
easier way would enable one-liners reports!
Anyway, html renderer (using python HTMLParser) is complex and
limited, maybe using web2py HTML helpers directly(not serialized)
would be a better, simpler and more robust approach (leaving width
unnecesary), but this is a major redesign.

B. PDF views would be great to separe presentation logic, but seems
views cannot be binary (and detecting the request extension in not so
clean either). There is a generic.pdf view that can be tested, but is
seems not working because some extra prints added by web2py templating
engine and/or some IO alteration/escaping.

C. I think report classes (defining header and footer) should be in
modules to gain some performance. Also, there should be a simple
layout report class (header=report title, footer=report page), so we
can encapsulate common code, and later add that on pyfpdf packages or
maybe in web2py tools.

If there is some concensus, we can make some patchs and try this alternatives.

Best regards,

Mariano Reingart
http://www.sistemasagiles.com.ar
http://reingart.blogspot.com



On Mon, Sep 27, 2010 at 10:44 PM, yamandu <[email protected]> wrote:
> Hi, I wrote a simple report the generates a PDF version using PyFPDF
> that comes now with web2py.
>
> I´ts here: http://web2pyslices.com/main/slices/take_slice/99
>
> My goal is share and start a discussion to get this type of code
> better.
> So, please, test it and comment!

Reply via email to