Yii 1.1: phpexcel


PHPExcel - OpenXML - Create Excel2007 documents in PHP - Spreadsheet engine Project providing a set of classes for the PHP programming language, which allow you to write to and read from different file formats, like Excel 2007, PDF, HTML, ... This project is built around Microsoft's OpenXML standard and PHP. Checkout the Features this class set provides, such as setting spreadsheet meta data (author, title, description, ...), multiple worksheets, different fonts and font styles, cell borders, fills, gradients, adding images to your spreadsheet and much, much more!

Want to bookmark this page? Please use http://www.phpexcel.net as the URL.




  • Yii 1.0 or above


  • Extract the release file under protected/extensions


See the following code example:

$data = array(
    1 => array ('Name', 'Surname'),
    array('Schwarz', 'Oliver'),
    array('Test', 'Peter')
$xls = new JPhpExcel('UTF-8', false, 'My Test Sheet');

Change Log

January 27, 2010

  • Initial release.

Total 18 comments

#14464 report it
drxy at 2013/08/13 02:09pm
Turkish character problem.


I have an error with my array data as follows.

$data = array(
            1 => array ('İSİM', 'SOYİSİM'),
            array('İŞÇÖ', 'ÇŞÖŞÜĞ')
        $xls = new JPhpExcel('UTF-8', false, 'My Test Sheet');

Above characters are turkish . How can i fix the problem ?

#13671 report it
nirmalroka at 2013/06/15 12:30pm
Hi Its not working my dynamic array couold any body solved it

I am trying to export my custom array to the excel sheet but its not working. My custom array is dynamic array wihc has the following format. Note that the it has no comma seperated array value so its not working for me. So i am searching for solution.

$data = array(
    1 => array ('Name', 'Surname')
    array('Schwarz', 'Oliver')
    array('Test', 'Peter')
#11751 report it
chaitsi at 2013/02/01 06:26am
how to save generated file

i have used this extension and its work fine. but when i save the file on my computer prior to open it, it works, but when i just download/open it, it frozes!

like if i s when i select open with(Microsft)...then file name is changed to test.xls.xlsx how can i fix that ?

#11435 report it
Hudson Nguyen at 2013/01/14 04:57am
This need some changes

The way you use $data in export is not gonna fly. In real wold when you need to pull 10K rows from data using Yii active record, what you get is an array of OBJECTS, not array of array. Consider performance and resource, you cannot convert that array to another array to export.

#10558 report it
whaleforever at 2012/11/04 10:07pm
why demo link is not working?

the "try out demo" link is not working can you fix it?

#10304 report it
deez at 2012/10/18 09:27am

Try Open Office free software that will save a file in excel format...

#9697 report it
nights at 2012/09/04 06:01am
Nice extension

Nice extension, very easy to setup...3 minutes. However, i dont own excel and to verify that the spreadsheet is valid i tried to upload to Google docs. However Google doesnt recognize the format. I think ive tried all type of excel documents without any problems in the past so probably the format is broken. Anyone know anything that could help? Will read some docs how to create excel sheets from scratch now. Thank you very much.

#8482 report it
bachem at 2012/06/06 05:53pm
font style

how is used font style?

For example _this_

#7071 report it
jpablo at 2012/02/22 09:12am
PHPExcel is used here??

I took a look at the code (just a few lines of code in 2 PHP file) and was unable to find any reference to the Codeplex phpexcel library. It this library used here? As far as I see is impossible to use the advanced functions of Codeplex, this class only allows to create cells and insert simple values creating XML at hand. I'm right?

#4245 report it
yusron at 2011/06/20 12:31am
only metadata

i have use this extension but fail... :( when I export only show metadata. like this :( http://www.yiiframework.com/forum/index.php?/topic/20626-ask-phpexcel-only-metadata/page__p__100974#entry100974

#2738 report it
saebaryo at 2011/02/03 03:11pm

where i can get documentation for this extensions? or i just use documentation from codeplex? i want to merge some cell and give style, but i don't know how to do.

#2277 report it
Sasha at 2010/12/06 06:32am
Thank you

it's much better then csv )

#432 report it
undaverse at 2010/06/03 10:36am
Doesn't work

I've a problem.

I've tried to create a document like in the example. but it create me a excel sheet only with the menu and nothing else

is anybody know what does it mean ?

#433 report it
undaverse at 2010/06/03 10:28am
2003 compatibility

Is there something about the compattibilities of the document for office 2003 ? I'm making some stuff for persons that use office 2003 and I need to garant that it will work on excel 2003.

there is something in phpexcel about compabitility but it's not present In that extension I see ....is anybody I've something about that ?

#496 report it
James at 2010/05/15 04:07am
new line?

Looks pretty promising. Any way to add a new line to a cell? I tried \n, but it just treated it as text.


#574 report it
jerry2801 at 2010/04/20 06:01am
reply to neel


it is you want to do?

#660 report it
neel at 2010/03/26 01:22pm
Good Job

Excellent work. How to remove menu bar from xls page when save? I don't want to export menu bar.

#916 report it
got 2 doodle at 2010/02/03 07:35pm
Any chance you can upload the file?

Hard to comment without a download, will you be uploading the file soon?


Leave a comment

Please to leave your comment.

Create extension
  • Yii Version: 1.1
  • License: New BSD License
  • Developed by: jerry2801
  • Category: File System
  • Votes: +26 / -12
  • Downloaded: 13,048 times
  • Created on: Jan 27, 2010
  • Last updated: Feb 9, 2010