A very interesting topic. I am in the same position.
> -----Urspr�ngliche Nachricht-----
> Von: K�ri Har�arson [SMTP:[EMAIL PROTECTED]]
> Gesendet am: Freitag, 18. Oktober 2002 12:54
> An: [EMAIL PROTECTED]
> Betreff: Formatting reports with Python
>
> Hello all,
>
> I would like to get some opinionated opinions from you
> on a design decision I have to make.
>
> The system we write and sell is written in Python, and now we
> need reports on paper. Until now, all reports have been made
> available from a website, but users complain that they don't look
> good enough and have unnecessary page feeds.
>
> We have been mulling over the methods available from Python:
>
> 1) Produce HTML but try to format it for a printer, not screen.
> Pagination will always be a problem, but this is the quickest way
> to do it.
HTML 4 supports all that, but MSIE and Netscape don't support HTML 4...
What you could also try is to generate RML (see ReportLab.com),
it is similarly to XHTML and a commercial tool from ReportLab can
generate PDF from it using the reportlab library.
>
> 2) Use the PDF format and learn how to use ReportLab. I must confess
> that the online tutorial seems daunting. In any case, the reader will
> have to install Adobe Acrobat Reader to have a look at the document, and
> not all employees at our clients have one installed. I do like this
> method the best right now.
Depending on what you need, it is quite straight-forward with ReportLab
and the platypus package.
However, if you produce reports from database data, then you probably
need table layouts a lot, and this is a bit tricky for long tables.
>
> 3) Learn how to use the RTF format. At least every user can open and
> print such a document from Wordpad if nothing else. Downside is, noone
> has an RTF based report generator for Python unless I'm mistaken ?
Writing
> in raw RTF doesn't sound fun.
I have used this method (generating raw RTF) for a demo (not in Python). It
works fine.
Formatting using format templates ("Formatvorlagen" in German) is a bit
tricky with RTF.
You'll need a to write a library which does most of the routine tasks.
Once you have such a library, it will be quite easy, but AFAIK there isn't
yet such a library.
>
> 4) Generate a Word Document by running Word via COM on the webserver
> where our system is running. This might crash the webserver and is
probably
> slow ?
I have tried generating Word documents with Python. It works basically,
but it is quite slow and I don't trust enough in Word-via-COM-stability.
>
> If someone has experience with one of the above methods or knows about
> yet another way to do this, I'd love to hear about it !
>
> Best regards,
>
> Kari Hardarson, Iceland
> _______________________________________________
> ActivePython mailing list
> [EMAIL PROTECTED]
> To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
> Other options:
http://listserv.ActiveState.com/mailman/listinfo/ActivePython
_______________________________________________
ActivePython mailing list
[EMAIL PROTECTED]
To unsubscribe: http://listserv.ActiveState.com/mailman/mysubs
Other options: http://listserv.ActiveState.com/mailman/listinfo/ActivePython