On Jul 16, 4:20 am, Jorge Godoy <[EMAIL PROTECTED]> wrote:
> On Monday 16 July 2007 02:12:31 iain duncan wrote:
> > I would like to add the option for my client to download ready to print
> > invoices as one big doc, and am wondering what people would use to do
> > that. I have heard good things about the Apache POI project, but it
> > seems to have only Ruby bindings. Anyone have any suggestions of what
> > they like?
>
> For Excel you can use CSV and it will open it.  If you really want an Excel
> spreadsheet there are some Python packages out there (PyExcelerator, IIRC, is
> one of them).  You'll need some of these packages if you're willing to create
> formulas and graphics.

If your users have modern Excel (2002+?) and Internet Explorer, you
can deliver Excel docs in the browser just by outputting an HTML
table. Set the following headers:

h = cherrypy.response.headers
h['Content-Type'] = "application/vnd.ms-excel;charset=utf-8"
h["Content-Disposition"] = ("inline; filename=%s.xls" % fname)

...and replace in-cell br tags with "<br style='mso-data-placement:
same-cell' />". You can include tags like b, i, a, and img, and
they'll all transfer nicely.


Robert Brewer
System Architect
Amor Ministries
[EMAIL PROTECTED]


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

Reply via email to