|
Posted by max on 04/22/07 23:22
Hi folks,
I'm trying to export a HTML table (generated by a PHP script) in a Excel
file. Everything works perfectly with the following lines:
header("Content-type: application/vnd.ms-excel");
header("Content-disposition: attachment; filename=FileGen.xls");
header("Pragma: no-cache");
header("Expires: 0");
print "$header\n$data";
However, the problem comes from the CSS file. Once Excel is loading the
generated file, I have a message saying that the CSS file is missing.
Then, no font, color or cells format. And the generated file is ugly and
barely usable. Also, the table contains on cell with a picture that is
not send to Excel.
I read that there are modules (like PEAR) that could generate
complicated files in Excel from PHP. However, my need is simple, and I
wnat, if possible, to make better the "header" solution.
I thought that I can include styles directly in the PHP file instead of
including them in a separate CSS file. Is that the solution?
TIA for your help,
A. Jean
Navigation:
[Reply to this message]
|