Page 1 of 1

Exporting large records to excel

Posted: Wed Jul 30, 2008 5:06 am
by jlising
Hello,

What is the best method to export large number of records into an excel file?
I'm having problem with my current script, it export records to an excel file using spreadsheet writer of pear.

Many Thanks!

Re: Exporting large records to excel

Posted: Thu Jul 31, 2008 12:53 pm
by ghurtado
I would suggest using CSV as a format, since excel has no trouble reading it and it is very simple to do with php.

http://us3.php.net/fgetcsv

Another, less known option, is to write a simple HTML file with actual HTML tables, which can be imported by Excel just fine.

Re: Exporting large records to excel

Posted: Thu Jul 31, 2008 5:47 pm
by deafpanda
What was the problem with the PEAR excel writer?

There's an excellent tutorial at http://devzone.zend.com/article/3336-Re ... s-with-PHP

Re: Exporting large records to excel

Posted: Thu Jul 31, 2008 5:57 pm
by omniuni
I second the CSV option. Easy to use with PHP, and easy to import to excel, or any other spreadsheet, for that matter.

Re: Exporting large records to excel

Posted: Fri Aug 01, 2008 1:56 am
by VladSun
There are some issues with Excel when importing CSV file with utf-8 charset. I couldn't find a way to tell Excel that the charset is utf-8.

Re: Exporting large records to excel

Posted: Thu Aug 21, 2008 4:52 am
by jlising
Thanks guys for your replies.

I can now export records using the spread sheet excel writer. One more problem is, when I export records containing special characters. Some characters (i.e. ñ, Ñ) are not properly interpreted.

Do you know how to solve this problem?

Regards,
Jess