English Deutsch Français Italiano Español Português 繁體中文 Bahasa Indonesia Tiếng Việt ภาษาไทย
All categories

The following is my php code and it does not work:
header("Content-Type: Application/ms-excel");
echo "";
echo "";
echo "";

echo "";
echo "";
echo "";
echo " Data in here ";
echo "
";
echo "
";

echo "
";

echo "
";

?>

Is there something wrong with it?

2006-07-13 08:36:24 · 3 answers · asked by John Belushi 2 in Computers & Internet Programming & Design

I am trying to dynamically write data to the spread sheet from a database.

2006-07-13 08:56:25 · update #1

3 answers

I don't know about fully creating an excel sheet with php, the trick i used for clients is to just generate a CSL that can be downloaded and imported direclty into excel (or anything else). Just make sure you set the Content-Type to text/text instead of text/html.

2006-07-13 08:59:48 · answer #1 · answered by John J 6 · 0 0

You should use PEAR's Spreadsheet_Excel_Writer package found at: http://pear.php.net/package/Spreadsheet_Excel_Writer/.

I used it for a project at work a while back. It worked pretty well but I seem to remember that cell formatting added a significant amount of time to render the spreadsheet. Also, I don't know if this applies to you, but I'm pretty sure that you can't use it to open an existing spreadsheet.

2006-07-13 11:50:27 · answer #2 · answered by Jody 3 · 0 0

That is too much like work. What I do is save the spreadsheet as a web page then post it on my site. If you put it within the css format it will look like it belongs, if not it will look like a spreadsheet page with a white background.

2006-07-13 08:53:08 · answer #3 · answered by jeepfaust 3 · 0 0

fedest.com, questions and answers