Pmate,

There is no "perfect" report generation tool.  ReportLabs is your best option for today.  I use Pisa (which is built on top of ReportLabs) for my reports.  Pisa basically converts a webpage into a report. (note that the rendering quality is not what you would expect from Firefox or IE, but with some custom, table-formatted pages, it works just fine).

Here's how my report chain works:
1) User goes to /app/controller/startReport - This generates a report request in the form of a local temporary file, it then runs a separate report generation script as a separate process, it serves a page that gets AJAX updates from /app/controller/pdfCycle
2) pdfCycle monitors the progress of the report generation and returns the state in JSON form to the requesting page script.
3) Once the report is complete, pdfCycle instructs the page to load the PDF in an iframe from a third url (/app/controller/fetchPdf)
4) Once fetchPdf reads the page from the temporary file, it cleans up (deletes all temporary files) and then serves the PDF.

Note that PDF report generation can be a little CPU hungry (think average of 3-5 seconds per page on a 1.5Ghz P4 or 1 second on our 3Ghz Quad Xeon) even though it is still an I/O bound process.

I have a function decorator that takes dictionary function output, runs it through a Genshi Template for the html code and then passes that to Pisa.

Reportlabs purposefully makes using their free stuff not so user-friendly because they want you to buy their better products (which are good, but way out of my companies price range).

-tim

pmate wrote:
Hi,
i read that reportlab it is perfect to generate reports from web2py.
Any tutorial, howto, online examples?
For example: is it better to embed the report generation code in a
separate controller (for example myprints.py) or it is good pratice to
embed it in the default one? I couldn't find any documentation about
this around.
Thanks

  

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "web2py Web Framework" group.
To post to this group, send email to web2py@googlegroups.com
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at http://groups.google.com/group/web2py?hl=en
-~----------~----~----~----~------~----~------~--~---

begin:vcard
fn:Timothy Farrell
n:Farrell;Timothy
org:Statewide General Insurance Agency;IT
adr:;;4501 East 31st Street;Tulsa;OK;74135;US
email;internet:[EMAIL PROTECTED]
title:Computer Guy
tel;work:(918)492-1446
url:www.swgen.com
version:2.1
end:vcard

Reply via email to