Skip to content

Commit 03e52f8

Browse files
committed
omit <dimension> in native writer
1 parent aa3a9ae commit 03e52f8

File tree

3 files changed

+37
-39
lines changed

3 files changed

+37
-39
lines changed

docs/bench-read.md

Lines changed: 18 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,18 @@
1-
Results for csv
2-
3-
```
4-
LeKoala\SpreadCompat\Csv\Native : 0.0161
5-
LeKoala\SpreadCompat\Csv\League : 0.1049
6-
LeKoala\SpreadCompat\Csv\OpenSpout : 0.3663
7-
LeKoala\SpreadCompat\Csv\PhpSpreadsheet : 6.2865
8-
```
9-
10-
Results for xlsx
11-
12-
```
13-
LeKoala\SpreadCompat\Xlsx\Native : 0.2062
14-
LeKoala\SpreadCompat\Xlsx\Simple : 0.3008
15-
LeKoala\SpreadCompat\Xlsx\OpenSpout : 3.5006
16-
LeKoala\SpreadCompat\Xlsx\PhpSpreadsheet : 8.6585
17-
```
1+
Results for csv
2+
3+
```
4+
LeKoala\SpreadCompat\Csv\Native : 0.0051
5+
LeKoala\SpreadCompat\Csv\League : 0.0093
6+
LeKoala\SpreadCompat\Csv\OpenSpout : 0.0236
7+
LeKoala\SpreadCompat\Csv\PhpSpreadsheet : 0.3935
8+
```
9+
10+
Results for xlsx
11+
12+
```
13+
LeKoala\SpreadCompat\Xlsx\Native : 0.0699
14+
LeKoala\SpreadCompat\Xlsx\Simple : 0.0896
15+
LeKoala\SpreadCompat\Xlsx\OpenSpout : 0.2172
16+
LeKoala\SpreadCompat\Xlsx\PhpSpreadsheet : 0.4913
17+
```
18+

docs/bench-write.md

Lines changed: 14 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,14 @@
1-
Results for csv
2-
3-
```
4-
LeKoala\SpreadCompat\Csv\Native : 0.0087
5-
LeKoala\SpreadCompat\Csv\League : 0.0275
6-
LeKoala\SpreadCompat\Csv\OpenSpout : 0.1561
7-
LeKoala\SpreadCompat\Csv\PhpSpreadsheet : 3.1852
8-
```
9-
10-
Results for xlsx
11-
12-
```
13-
LeKoala\SpreadCompat\Xlsx\Native : 0.194
14-
LeKoala\SpreadCompat\Xlsx\OpenSpout : 0.9734
15-
LeKoala\SpreadCompat\Xlsx\Simple : 1.63
16-
LeKoala\SpreadCompat\Xlsx\PhpSpreadsheet : 6.0976
17-
```
1+
Results for csv
2+
3+
LeKoala\SpreadCompat\Csv\Native : 0.0052
4+
LeKoala\SpreadCompat\Csv\League : 0.0072
5+
LeKoala\SpreadCompat\Csv\OpenSpout : 0.0188
6+
LeKoala\SpreadCompat\Csv\PhpSpreadsheet : 0.1976
7+
8+
Results for xlsx
9+
10+
LeKoala\SpreadCompat\Xlsx\Simple : 0.0355
11+
LeKoala\SpreadCompat\Xlsx\Native : 0.0494
12+
LeKoala\SpreadCompat\Xlsx\OpenSpout : 0.1305
13+
LeKoala\SpreadCompat\Xlsx\PhpSpreadsheet : 0.301
14+

src/Xlsx/Native.php

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -476,16 +476,16 @@ protected function genWorksheet(iterable $data, bool $memory = true)
476476
$r = 0;
477477

478478
// Since we don't know in advance, let's have the max
479-
$MAX_ROW = 1048576;
480-
$MAX_COL = 16384;
481-
482-
$maxCell = SpreadCompat::excelCell($MAX_ROW, $MAX_COL);
479+
// $MAX_ROW = 1048576;
480+
// $MAX_COL = 16384;
481+
// $maxCell = SpreadCompat::excelCell($MAX_ROW, $MAX_COL);
482+
// This would help to create <dimension ref="A1:XFE1048577"/> but it can be seen as broken
483+
// This is why we simply omit the <dimension> tag
483484

484485
$header = <<<XML
485486
<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
486487
<worksheet xmlns="http://schemas.openxmlformats.org/spreadsheetml/2006/main"
487488
xmlns:r="http://schemas.openxmlformats.org/officeDocument/2006/relationships">
488-
<dimension ref="A1:{$maxCell}"/>
489489
<cols>
490490
<col collapsed="false" hidden="false" max="1024" min="1" style="0" customWidth="false" width="11.5"/>
491491
</cols>

0 commit comments

Comments
 (0)