Skip to content

Commit 781b247

Browse files
author
Mark Baker
authored
Documentation updates (#2131)
* Update notes in documentation for memory sizing on 32-bit and 64-bit PHP versions * Additional notes on the fact that PHPSpreadsheet does not change cell addresses when loading a spreadsheet using a Read Filter
1 parent 1d86840 commit 781b247

File tree

3 files changed

+10
-1
lines changed

3 files changed

+10
-1
lines changed

docs/topics/memory_saving.md

+1-1
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
# Memory saving
22

3-
PhpSpreadsheet uses an average of about 1k per cell in your worksheets, so
3+
PhpSpreadsheet uses an average of about 1k per cell (1.6k on 64-bit PHP) in your worksheets, so
44
large workbooks can quickly use up available memory. Cell caching
55
provides a mechanism that allows PhpSpreadsheet to maintain the cell
66
objects in a smaller size of memory, or off-memory (eg: on disk, in APCu,

docs/topics/reading-and-writing-to-file.md

+5
Original file line numberDiff line numberDiff line change
@@ -139,6 +139,11 @@ $reader->setReadFilter( new MyReadFilter() );
139139
$spreadsheet = $reader->load("06largescale.xlsx");
140140
```
141141

142+
Read Filtering does not renumber cell rows and columns. If you filter to read only rows 100-200, cells that you read will still be numbered A100-A200, not A1-A101. Cells A1-A99 will not be loaded, but if you then try to call `getCell()` for a cell outside your loaded range, then PHPSpreadsheet will create a new cell with a null value.
143+
144+
Methods such as `toArray()` assume that all cells in a spreadsheet has been loaded from A1, so will return null values for rows and columns that fall outside your filter range: it is recommended that you keep track of the range that your filter has requested, and use `rangeToArray()` instead.
145+
146+
142147
### \PhpOffice\PhpSpreadsheet\Writer\Xlsx
143148

144149
#### Writing a spreadsheet

docs/topics/reading-files.md

+4
Original file line numberDiff line numberDiff line change
@@ -324,6 +324,10 @@ to read and process a large workbook in "chunks": an example of this
324324
usage might be when transferring data from an Excel worksheet to a
325325
database.
326326

327+
Read Filtering does not renumber cell rows and columns. If you filter to read only rows 100-200, cells that you read will still be numbered A100-A200, not A1-A101. Cells A1-A99 will not be loaded, but if you then try to call `getCell()` for a cell outside your loaded range, then PHPSpreadsheet will create a new cell with a null value.
328+
329+
Methods such as `toArray()` assume that all cells in a spreadsheet has been loaded from A1, so will return null values for rows and columns that fall outside your filter range: it is recommended that you keep track of the range that your filter has requested, and use `rangeToArray()` instead.
330+
327331
```php
328332
$inputFileType = 'Xls';
329333
$inputFileName = './sampleData/example2.xls';

0 commit comments

Comments
 (0)