-
Notifications
You must be signed in to change notification settings - Fork 26
Expand file tree
/
Copy pathphpexcel_faq.html
More file actions
173 lines (173 loc) · 12 KB
/
phpexcel_faq.html
File metadata and controls
173 lines (173 loc) · 12 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>PHPOffice</title>
<link href="statics/css/bootstrap.min.css" rel="stylesheet">
<link href="statics/css/bootstrap-responsive.min.css" rel="stylesheet">
<link href="statics/css/gh-fork-ribbon.css" rel="stylesheet" />
<!--[if IE]>
<link href="statics/css/gh-fork-ribbon.ie.css" rel="stylesheet" />
<![endif]-->
<link href="statics/css/style.css" rel="stylesheet">
</head>
<body>
<div class="github-fork-ribbon-wrapper right">
<div class="github-fork-ribbon">
<a href="https://github.com/PHPOffice/PHPExcel">Fork me on GitHub</a>
</div>
</div>
<div class="navbar navbar-inverse navbar-fixed-top">
<div class="navbar-inner">
<div class="container-fluid">
<a class="brand" href="index.html">PHPOffice</a>
<div class="nav-collapse collapse">
<ul class="nav">
<li><a href="index.html">Home</a></li>
<li class="active"><a href="phpexcel_features.html">PHPExcel</a></li>
<li><a href="#">PHPPowerPoint</a></li>
<li><a href="#">PHPProject</a></li>
<li><a href="#">PHPVisio</a></li>
<li><a href="#">PHPWord</a></li>
</ul>
</div><!-- /.nav-collapse -->
</div>
</div><!-- /navbar-inner -->
</div><!-- /navbar -->
<div class="container-fluid">
<div class="row-fluid">
<div class="span2">
<div class="well sidebar-nav">
<ul class="nav nav-list">
<li><a href="index.html">Home</a></li>
<li><a href="team.html">Team</a></li>
<li class="nav-header">PHPExcel</li>
<li><a href="phpexcel_news.html">News</a></li>
<li><a href="phpexcel_features.html">Features</a></li>
<li><a href="phpexcel_requirements.html">Requirements</a></li>
<li class="active"><a href="phpexcel_faq.html">FAQ</a></li>
<li><a href="phpexcel_contribute.html">Contribute</a></li>
<li><a href="phpexcel_roadmap.html">Roadmap</a></li>
<li><a href="phpexcel_resources.html">Resources</a></li>
<li><a href="phpexcel_credits.html">Credits</a></li>
</ul>
</div><!--/.well -->
</div><!--/span-->
<div class="span10">
<h1>FAQ</h1>
<div class="well">
<strong>There seems to be a problem with character encoding...</strong><br />
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.
</div>
<div class="well">
<strong>PHP complains about ZipArchive not being found</strong><br />
Make sure you meet all Requirements, especially php_zip extension should be enabled.<br />
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.<br />
This can be enabled by calling:<br />
<pre>PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);</pre>
before calling the save method of the Excel2007 Writer.<br />
You can revert to using ZipArchive by calling:<br />
<pre>PHPExcel_Settings::setZipClass(PHPExcel_Settings::ZIPARCHIVE);</pre>
At present, this only allows you to write Excel2007 files without the need for ZipArchive (not to read Excel2007 or OOCalc)
</div>
<div class="well">
<strong>Excel 2007 can not open the file generated by PHPExcelWriter2007 on Windows</strong><br />
<em>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.</em><br />
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 <a href="http://bugs.php.net/48763">http://bugs.php.net/48763</a> for details. The version that can be found on <a href="http://snaps.php.net/win32/php5.2-win32-latest.zip">http://snaps.php.net/win32/php5.2-win32-latest.zip</a> should work at all times.<br />
<br />
Alternatively, upgrading to at least PHP 5.2.9 should solve the problem.<br />
<br />
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.
</div>
<div class="well">
<strong>Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate yyy bytes) in zzz on line aaa</strong><br />
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);<br />
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 <a href="http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=234150">http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=234150</a><br />
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 <a href="http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=242712">http://phpexcel.codeplex.com/Thread/View.aspx?ThreadId=242712</a>
</div>
<div class="well">
<strong>Protection on my worksheet is not working?</strong><br />
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:
<pre>$objPHPExcel->getActiveSheet()->getProtection()->setSheet(true);</pre>
</div>
<div class="well">
<strong>Feature X is not working with PHPExcelReaderY / PHPExcelWriterZ</strong><br />
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.<br />
<br />
For example autofilter is not implemented in PEAR SpreadsheetExcelwriter, which is the base of our Excel5 writer.<br />
<br />
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.
</div>
<div class="well">
<strong>Formulas don’t seem to be calculated in Excel2003 using compatibility pack?</strong><br />
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.
</div>
<div class="well">
<strong>Setting column width is not 100% accurate</strong><br />
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.<br />
<br />
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".
</div>
<div class="well">
<strong>How do I use PHPExcel with my framework ... ?</strong><br />
<strong>Bakery</strong>
<ul>
<li>The Bakery has some helper classes for reading and writing with PHPExcel within CakePHP : <a href="http://bakery.cakephp.org/articles/melgior/2010/01/26/simple-excel-spreadsheet-helper">http://bakery.cakephp.org/articles/melgior/2010/01/26/simple-excel-spreadsheet-helper</a></li>
<li>And : <a href="http://bakery.cakephp.org/articles/segy/2012/04/02/phpexcel_helper_for_generating_excel_files">http://bakery.cakephp.org/articles/segy/2012/04/02/phpexcel_helper_for_generating_excel_files</a></li>
</ul>
<strong>CakePHP</strong>
<ul>
<li>PHPExcelをCakePHPで使ってみる : <a href="http://www.okushin.co.jp/kodanuki_note/2010/06/phpexcelcakephp.html">http://www.okushin.co.jp/kodanuki_note/2010/06/phpexcelcakephp.html</a></li>
</ul>
<strong>CodeIgniter</strong>
<ul>
<li>Danny Herran seems to have got PHPExcel working installed as a CodeIgniter library according to this recent post on his blog : <a href="http://www.dannyherran.com/2011/03/exporting-your-mysql-table-data-with-phpexcel-codeigniter/">http://www.dannyherran.com/2011/03/exporting-your-mysql-table-data-with-phpexcel-codeigniter/</a></li>
</ul>
<strong>Contao</strong>
<ul>
<li>PHPExcel for the Contao CMS : <a href="http://contao.org/en/extension-list/view/php_excel.en.html">http://contao.org/en/extension-list/view/php_excel.en.html</a></li>
</ul>
<strong>Joomla</strong>
<ul>
<li><a href="http://forum.joomla.org/viewtopic.php?p=2174929">http://forum.joomla.org/viewtopic.php?p=2174929</a></li>
</ul>
<strong>Kohana</strong>
<ul>
<li>Integrating PHPExcel into Kohana : <a href="http://www.flynsarmy.com/2010/07/phpexcel-module-for-kohana-3/">http://www.flynsarmy.com/2010/07/phpexcel-module-for-kohana-3/</a></li>
<li>Интеграция PHPExcel и Kohana Framework : <a href="http://szpargalki.blogspot.com/2011/02/phpexcel-kohana-framework.html">http://szpargalki.blogspot.com/2011/02/phpexcel-kohana-framework.html</a></li>
</ul>
<strong>Symfony</strong>
<ul>
<li>Using PHP with Symfony : <a href="http://symfony.acobby.com/2011/06/using-phpexcel-with-symfony.html?spref=tw">http://symfony.acobby.com/2011/06/using-phpexcel-with-symfony.html?spref=tw</a></li>
</ul>
<strong>Symfony 2</strong>
<ul>
<li>Using PHPExcel with Symfony 2 : <a href="https://github.com/liuggio/ExcelBundle">https://github.com/liuggio/ExcelBundle</a></li>
</ul>
<strong>Typo3</strong>
<ul>
<li>Using PHPExcel with Typo3 : <a href="http://typo3.org/documentation/document-library/extension-manuals/phpexcel_library/1.1.1/view/toc/0/">http://typo3.org/documentation/document-library/extension-manuals/phpexcel_library/1.1.1/view/toc/0/</a></li>
<li>A PHPExcel service for Typo3 : <a href="http://typo3.org/extensions/repository/view/phpexcel_service/current/">http://typo3.org/extensions/repository/view/phpexcel_service/current/</a></li>
</ul>
<strong>Yii</strong>
<ul>
<li>A page of advice on using PHPExcel in the Yii framework : <a href="http://www.yiiframework.com/wiki/101/how-to-use-phpexcel-external-library-with-yii/">http://www.yiiframework.com/wiki/101/how-to-use-phpexcel-external-library-with-yii/</a></li>
<li>On avoiding problems between the Yii autoloader and PHPExcel autoloader : <a href="http://www.mrsoundless.com/post/2011/04/23/PHPExcel-in-Yii.aspx">http://www.mrsoundless.com/post/2011/04/23/PHPExcel-in-Yii.aspx</a></li>
<li><a href="http://www.yiiframework.com/forum/index.php/topic/29225-tip-using-phpexcel-with-yii/">http://www.yiiframework.com/forum/index.php/topic/29225-tip-using-phpexcel-with-yii/</a></li>
</ul>
</div>
<div class="well">
<strong>Joomla Autoloader interferes with PHPExcel Autoloader</strong><br />
Thanks to peterrlynch for the following advice on resolving issues between the PHPExcel autoloader and Joomla Autoloader : <a href="http://phpexcel.codeplex.com/discussions/211925">Joomla & PHPExcel > 1.7.2 Issue</a>
</div>
<div class="well">
<strong>Resolving Yii Autoloader problems with the PHPExcel Autoloader</strong><br />
A useful blog post on avoiding autoloader problems between the Yii autoloader and PHPExcel : <a href="http://www.mrsoundless.com/post/2011/04/23/PHPExcel-in-Yii.aspx">http://www.mrsoundless.com/post/2011/04/23/PHPExcel-in-Yii.aspx</a>
</div>
</div><!--/span-->
</div><!--/row-->
</div><!--/.fluid-container-->
<script src="http://ajax.googleapis.com/ajax/libs/jquery/1.7.2/jquery.min.js"></script>
<script src="statics/js/bootstrap.min.js"></script>
</body>
</html>