RE: FN-FORUM: PHP generate xls
date posted 30th October 2007 15:56
Terry wrote:
> I was wondering if anyone knew of a way to generate spread sheets
> with separate work sheets using PHP, I've read a little about using
> COM, but wondered if there was a way without having office (excel)
> installed on the server.
Hello Terry
The typical way I've seen this done is to generate CSV rather than XLS, as
this is easy to generate from any scripting language and is much less of a
resource hog than instantiating Office components, etc.
Simply write out your data in the following form:
Column Name1, Column Name2, Column Name3, Column Name4
1,'dog','cat',456
2,'sheep wool','pidgeon',789
1,'dog''s life','moose',012
If office is installed on the user's machine, CSV is normally associated
with Excel and will open up looking exactly like a normal spreadsheet.
Cheers, Ben
--
Ben Johnson, Neogic Web Solutions
// design . development . managed hosting
w | http://www.neogic.com
t | +44 (0)1242 808 262
e | [EMAIL REMOVED]