Hi,
Can i write to MS-Excel using PHP? I am using PHP 5 on Linux. Any help
would be appreciated!
>
Thanks,
Raghu
That depends - you can write a file, which Excel can read, and add a
link to that. AFAIK only ASP has an option to open a file in Excel.
Correct me if I am wrong.
For tricks with numbers, try:
<STYLE TYPE="text/css"><!--
.number2dec {mso-number-format: Fixed;}
--></STYLE>
and use it like
<td class=""number2 dec"">" . $price ."</td><td class=""number2 dec"">
=d" . $y1 . "*e" . $y2 ."</td>"
This will add the first as a number, and the seconds as a fomula.
Hi,
Can i write to MS-Excel using PHP? I am using PHP 5 on Linux. Any help
would be appreciated!
>
Thanks,
Raghu
>
As mentioned, the Pear package works well.
If your target spreadsheet is very complicated, though, you could always
just write out a csv file of the data, and use some VBA code in Excel to
import it as you saw fit.
This would however entail the user running macros when the sheet opens,
and not all folks like to do that.
Easy! Just give an XML, HTML, CSV or other file an ".xls"
extension. Excel will load it like it and display it and
manipulate it just fine.
Really though - Spreadsheet_Exc ell_Writer is not that difficult and there
are good examples of its use on the web - it gives so much more with only a
little bit of learning.
Comment