Heyooo
Ok so I need to create an excel file on the fly. I took at look at the pear package one but I don't have PEAR installed and I don't know how to install it and whatnot and it just seams like overkill right now. I then tried some other ones from php classes and elsewhere to no avail yet.
Does anyone know of a good script that works to create excel files?
Create Excel file
Moderator: General Moderators
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA
Visit PHP Classes and search there. I found one a few years ago that still serves me very well.
EDIT | I swear to all that is cheesy about pizza that I cannot write the word s-e-r-v-e without adding an 'r' to the end of it.
EDIT | I swear to all that is cheesy about pizza that I cannot write the word s-e-r-v-e without adding an 'r' to the end of it.
- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
while I am searching there can someone tell me what is wrong with this code? I am making a csv file on the fly and trying to send it to excel but excel just opens with a blank spreadsheat. I know the csv file has everything in it correct so I donno.
Code: Select all
$Lines = array();
while ($info = mysql_fetch_assoc($query))
{
$Lines[] = '"'.$info['file_name'].'",'.$info['first_name'];
}
$Lines = implode("\n", $Lines);
$handle = fopen('tmpfile.csv', 'w');
fwrite($handle, $Lines);
fclose($handle);
header ('Content-Type: application/msexcel');
header ('Content-Disposition: attachment; filename="tmpfile.csv"');- shiznatix
- DevNet Master
- Posts: 2745
- Joined: Tue Dec 28, 2004 5:57 pm
- Location: Tallinn, Estonia
- Contact:
readfile() yaaaa
But I got it with a fun excel writer that was found. The one I am gonna use is: http://www.phpclasses.org/browse/package/2037.html
But I got it with a fun excel writer that was found. The one I am gonna use is: http://www.phpclasses.org/browse/package/2037.html
- RobertGonzalez
- Site Administrator
- Posts: 14293
- Joined: Tue Sep 09, 2003 6:04 pm
- Location: Fremont, CA, USA