[Zope] Sending results of query to Excel

Satheesh Babu vsbabu@csoft.net
Tue, 11 Apr 2000 08:03:52 -0400


Hi,

I had a similar situation. Solved it like this -
1) A link says "click here to generate EXCEL file"
2) Clicking on it just re-queries the database and outputs a CSV file
3) Before printing the output, send a header application-text/x-csv... (I
don't remember exact one, but you can find it from Win95/98 file types)

With IE, specify the link target as some other window and it will open Excel
properly
With Netscape, most probably, the CSV file is opened by the browser - users
will've to
define the helper application for this file type as Excel in their NS
preferences menu.

If you need formatting, send it as HTML, but Excel will probably crash
reading that
file, if it is slightly big. SYLK format is better, but it takes time to get
your data into
SYLK.

If the queries are not time consuming and if you have Excel 97 or higher,
you can
give some macros to users to either use "Web query" feature of Excel, or
again
write an OLE DB script... In that case, one doesn't need Zope. Just listing
options :-)