You are here: Export from PHP to Excel - problem with CSS file « PHP Language « IT news, forums, messages
Export from PHP to Excel - problem with CSS file

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]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация