Click to See Complete Forum and Search --> : Generation of excel file


sadanandam
10-18-2006, 08:22 AM
Hi,

I need code for storing my output into an excel file. I need to store this file in the server.
We are using Spreadsheet_Excel_Writer from Pear package.

I could send it as attachment. But I need to store it in the server.

Code for sending as attachment:

header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=$filename");
header("Expires: 0");
header("Cache-Control: must-revalidate, post-check=0,pre-check=0");
header("Pragma: public");

If anybody has done it before, pls help.

Thanks,
Sadanandam.

pipeten
10-18-2006, 03:33 PM
Heya,
You need to look into fopen, fwrite and maybe ob_* (ob_start, ob_flush) depending how your going to do it.