Jump to content

[SOLVED] Create Excel File


sseeley

Recommended Posts

Getting data from an SQL table is fairly easy,but you must first tell me how is yuor SQL table is arranged.

 

For the excel sheet, it is not that easy, the only current PHP excel sheet writer and reader that I know of and that I have not tested yet is at:

 

http://pear.php.net/package/Spreadsheet_Excel_Writer

 

I recommend downloading it and try to make it to your desires.

You don't need to create an actual .xls file in order to have a "downloadble Excel sheet." If you output the correct Content-Type: header followed by tabular data, excel can probably handle it - http://www.the-art-of-web.com/php/dataexport/

 

Do you have an example of what you are trying publish?

You don't need to create an actual .xls file in order to have a "downloadble Excel sheet." If you output the correct Content-Type: header followed by tabular data, excel can probably handle it - http://www.the-art-of-web.com/php/dataexport/

 

Do you have an example of what you are trying publish?

The latest version of Excel will warn users before opening the file though.  Fine for a free site maybe, but not in a business environment.

I've used each of the following to create Excel files and they work great:

http://pear.php.net/package/Spreadsheet_Excel_Writer

http://www.codeplex.com/PHPExcel

 

I'd recommend PHPExcel (thanks roopurt18) if you want to create a real Excel file rather than a CSV file. A real Excel file has a number of benefits, including formatting cells and values, and the inclusion of images, which you can't do with a CSV file.

Despite the complexities of the Excel file format, using any of the libraries mentioned in this thread makes it very easy to write Excel files from within PHP, because they hide all the complexities; and most are well documented

Archived

This topic is now archived and is closed to further replies.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.