1. CSS formatting is a good idea, but most browsers don't do a good job at
implementing it. For example,
<div style="page-break-inside: avoid">
works only in Opera but neither in Mozilla nor in IE; they ruthlessly cut right
across even table cells and rows. So, if you don't want to count the lines of
every page you are putting out and manually insert each page break, CSS is not
really an option; this leaves only PDF.
2. Reportlab has a special XML source format for PDF generation, called RML,
that does have table support. It should be pretty straightforward to generate
RML from XHTML or the other way around, whatever looks better to you. I would
probably use ElementTree to do that (look at effbot.org).
The RML user guide is in the Reportlab download, but not the PDF rendering
engine, which is non-free. However, there is a free (pure Python) program that
does the same (and pretty fast, too). You can find it here:
Eduardo Elgueta wrote:
> Hi All,
> I have a small webware application in which I need to produce reports to
> be printed. Right now, html reports produce poor results (pagination is
> not constant).
> I bigger companies, we use Crystal Reports, but this is a small
> non-for-profit organization, so we can't afford commercial software.
> What are you guys using?
> I was checking out reportlab, but it seems a lot of work, and I couldn't
> find tables support.
> Best regards,
Dept. of Chemistry, University of Waterloo
200 University Ave W
N2L 3G1 Waterloo, ON
Phone: (519) 888-4567 ext. 5100
Fax: (519) 746-0435
Office: ESC-234 Lab: ESC-241