Home Features Requirements Examples FAQ Contribute Documents Credits Contact

FAQ

Is there a roadmap for PHPExcel development?

There is, the roadmap for 2013 can be found here http://phpexcel.codeplex.com/discussions/428190

There seems to be a problem with character encoding...

It is necessary to use UTF-8 encoding for all texts in PHPExcel. If the script uses different encoding then it is possible to convert the texts with PHP's iconv() function.

PHP complains about ZipArchive not being found

Make sure you meet all Requirements, especially php_zip extension should be enabled.
The ZipArchive class is only required when reading or writing formats that use Zip compression (Excel2007 and OOCalc). From version 1.7.6 the PCLZip library has been bundled with PHPExcel as an alternative to the ZipArchive class.
This can be enabled by calling:
PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
before calling the save method of the Excel2007 Writer.

You can revert to using ZipArchive by calling:
PHPExcel_Settings::setZipClass(PHPExcel_Settings::ZIPARCHIVE);

At present, this only allows you to write Excel2007 files without the need for ZipArchive (not to read Excel2007 or OOCalc)

Excel 2007 can not open the file generated by PHPExcelWriter2007 on Windows

Excel found unreadable content in '*.xlsx'. Do you want to recover the contents of this workbook? If you trust the source of this workbook, click Yes.

The php_zip extension on Windows coming with PHP 5.2.6 and PHP 5.2.8 contains an error when creating ZIP files. See http://bugs.php.net/48763 for details. The version that can be found on http://snaps.php.net/win32/php5.2-win32-latest.zip should work at all times.

Alternatively, upgrading to at least PHP 5.2.9 should solve the problem.

If you can’t locate a clean copy of ZipArchive, then you can use the PCLZip library as an alternative when writing Excel2007 files, as described above.

Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate yyy bytes) in zzz on line aaa

PHPExcel holds an "in memory" representation of a spreadsheet, so it is susceptible to PHP's memory limitations. The memory made available to PHP can be increased by editing the value of the memorylimit directive in your php.ini file, or by using iniset('memory_limit', '128M') within your code (ISP permitting);

Some Readers and Writers are faster than others, and they also use differing amounts of memory. You can find some indication of the relative performance and memory usage for the different Readers and Writers, over the different versions of PHPExcel, here http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=234150

If you've already increased memory to a maximum, or can't change your memory limit, then this discussion on the board describes some of the methods that can be applied to reduce the memory usage of your scripts using PHPExcel http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=242712

Protection on my worksheet is not working?

When you make use of any of the worksheet protection features (e.g. cell range protection, prohibiting deleting rows, ...), make sure you enable worksheet security. This can for example be done like this:
$objPHPExcel->getActiveSheet()->getProtection()->setSheet(true);


Feature X is not working with PHPExcelReaderY / PHPExcelWriterZ

Not all features of PHPExcel are implemented in all of the Reader / Writer classes. This is mostly due to underlying libraries not supporting a specific feature or not having implemented a specific feature.

For example autofilter is not implemented in PEAR SpreadsheetExcelwriter, which is the base of our Excel5 writer.

We are slowly building up a list of features, together with the different readers and writers that support them, in the "Functionality Cross-Reference.xls" file in the /Documentation folder.

Formulas don’t seem to be calculated in Excel2003 using compatibility pack?

This is normal behaviour of the compatibility pack, Excel2007 displays this correctly. Use PHPExcelWriterExcel5 if you really need calculated values, or force recalculation in Excel2003.

Setting column width is not 100% accurate

Trying to set column width, I experience one problem. When I open the file in Excel, the actual width is 0.71 less than it should be.

The short answer is that PHPExcel uses a measure where padding is included. There is more information about why this is the case and how to deal with it in the "PHPExcel Developer Documentation".

How do I use PHPExcel with my framework

There's some instructions for using PHPExcel with Joomla on the Joomla message board http://forum.joomla.org/viewtopic.php?p=2174929
There's also a nice library package on github to simplify installing PHPExcel for joomla https://github.com/vdespa/PHPExcel-Joomla-Library
A page of advice on using PHPExcel in the Yii framework http://www.yiiframework.com/wiki/101/how-to-use-phpexcel-external-library-with-yii/
and on avoiding problems between the Yii autoloader and PHPExcel autoloader http://www.mrsoundless.com/post/2011/04/23/PHPExcel-in-Yii.aspx
The Bakery has some helper classes for reading and writing with PHPExcel within CakePHP http://bakery.cakephp.org/articles/melgior/2010/01/26/simple-excel-spreadsheet-helper and http://bakery.cakephp.org/articles/segy/2012/04/02/phpexcel_helper_for_generating_excel_files
PHPExcelをCakePHPで使ってみる http://www.okushin.co.jp/kodanuki_note/2010/06/phpexcelcakephp.html
Integrating PHPExcel into Kohana http://www.flynsarmy.com/2010/07/phpexcel-module-for-kohana-3/ and
Интеграция PHPExcel и Kohana Framework http://szpargalki.blogspot.com/2011/02/phpexcel-kohana-framework.html
Using PHPExcel with Typo3 http://typo3.org/documentation/document-library/extension-manuals/phpexcel_library/1.1.1/view/toc/0/
A PHPExcel service for Typo3 http://typo3.org/extensions/repository/view/phpexcel_service/current/
Danny Herran seems to have got PHPExcel working installed as a CodeIgniter library according to this recent post on his blog http://www.dannyherran.com/2011/03/exporting-your-mysql-table-data-with-phpexcel-codeigniter/
Using PHP with Symfony http://symfony.acobby.com/2011/06/using-phpexcel-with-symfony.html?spref=tw
Using PHPExcel with Symfony 2 https://github.com/liuggio/ExcelBundle
PHPExcel for the Contao CMS http://contao.org/en/extension-list/view/php_excel.en.html

Joomla Autoloader interferes with PHPExcel Autoloader

Thanks to peterrlynch for the following advice on resolving issues between the PHPExcel autoloader and Joomla Autoloader
Joomla & PHPExcel > 1.7.2 Issue

Resolving Yii Autoloader problems with the PHPExcel Autoloader

A useful blog post on avoiding autoloader problems between the Yii autoloader and PHPExcel http://www.mrsoundless.com/post/2011/04/23/PHPExcel-in-Yii.aspx

Last edited Apr 17, 2013 at 7:16 AM by maartenba, version 48