>     I want to query an oracle database and push the output to an MS
> Excel spreadsheet . Currently I am dumping it to a csv text file and
> reading into Excel.
>     Is there a better way to do this?? Is there a php function for this ??

What I am doing is using PHP to generate an HTML table in the
format that I want to display the db results in.  Then, at the top
of this file, I include the following code:

<code_snippet>

Header("Content-Disposition: inline; filename=filename.xls");
Header("Content-Description: PHP3 Generated Data");
Header("Content-type: application/vnd.ms-excel; name='excel'");
flush();

</code_snippet>

The browser will get those headers, see that it's receiving an
excel file and proceed to launch Excel.  And Excel is good enough
to know and process HTML and your data is displayed appropriately.
It's very cool and very easy to implement.

Chris

Reply via email to