Re: generate xls file on fly
| From: | Per Jessen | Date: | Fri, 08 Feb 2008 14:17:33 +0000 |
| Subject: | Re: generate xls file on fly | ||
| References: | 1 | Groups: | php.general |
| Request: | Send a blank email to php-general+get-268937@lists.php.net to get a copy of this message | ||
Hiep Nguyen wrote:
> is there anyway to generate this into xls file w/o using fopen &
> fwrite to the server? my goal is to have a link after the table and
> user can click on that link and a save window pop up to allow user to
> save to local disk.
Yes - have a link like this:
<a href="<yourscript.php?parameters>">Get XLS file</a>
in yourscript.php, you evaluate the parameters given and build the XSL
file as output:
header("Content-Type: application/excel");
header("Content-Disposition: attachment; filename=\"filename\"");
print
.
.
.
.
.
done.
/Per Jessen, Zürich