parent
2b41bdbf4e
commit
39b55ded30
20
CHANGELOG.md
20
CHANGELOG.md
|
@ -29,6 +29,26 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
|
||||||
- c:max and c:min elements shall NOT be inside c:orientation elements - @vitalyrepin [#869](https://github.com/PHPOffice/PHPExcel/pull/869)
|
- c:max and c:min elements shall NOT be inside c:orientation elements - @vitalyrepin [#869](https://github.com/PHPOffice/PHPExcel/pull/869)
|
||||||
- Implement actual timezone adjustment into PHPExcel_Shared_Date::PHPToExcel - @sim642 [#489](https://github.com/PHPOffice/PHPExcel/pull/489)
|
- Implement actual timezone adjustment into PHPExcel_Shared_Date::PHPToExcel - @sim642 [#489](https://github.com/PHPOffice/PHPExcel/pull/489)
|
||||||
|
|
||||||
|
### BREAKING CHANGE
|
||||||
|
|
||||||
|
- Introduction of namespaces for all classes, eg: `PHPExcel_Calculation_Function` becomes `PhpOffice\PhpSpreadsheet\Calculation\Functions`
|
||||||
|
- Some classes were renamed for clarity and/or consistency:
|
||||||
|
|
||||||
|
| Before | After |
|
||||||
|
|---------------------------------|-------------------------------------------|
|
||||||
|
| `PHPExcel` | `PhpOffice\PhpSpreadsheet\Spreadsheet` |
|
||||||
|
| `PHPExcel_Reader_Excel2007` | `PhpOffice\PhpSpreadsheet\Reader\Xlsx` |
|
||||||
|
| `PHPExcel_Writer_Excel2007` | `PhpOffice\PhpSpreadsheet\Writer\Xlsx` |
|
||||||
|
|
||||||
|
- Some methods were renamed for clarity and/or consistency:
|
||||||
|
|
||||||
|
| Before | After |
|
||||||
|
|--------------------------------------------------|------------------------------------------------------------|
|
||||||
|
| `PHPExcel_Calculation_DateTime::DAYOFWEEK()` | `PhpOffice\PhpSpreadsheet\Calculation\DateTime::WEEKDAY()` |
|
||||||
|
| `PHPExcel_Calculation_DateTime::WEEKOFYEAR()` | `PhpOffice\PhpSpreadsheet\Calculation\DateTime::WEEKNUM()` |
|
||||||
|
| `PHPExcel_Calculation_DateTime::MINUTEOFHOUR()` | `PhpOffice\PhpSpreadsheet\Calculation\DateTime::MINUTE()` |
|
||||||
|
| `PHPExcel_Calculation_DateTime::SECONDOFMINUTE()`| `PhpOffice\PhpSpreadsheet\Calculation\DateTime::SECOND()` |
|
||||||
|
|
||||||
|
|
||||||
## [1.8.1] - 2015-04-30
|
## [1.8.1] - 2015-04-30
|
||||||
|
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'SYLK';
|
// $inputFileType = 'SYLK';
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'Gnumeric';
|
// $inputFileType = 'Gnumeric';
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'Gnumeric';
|
// $inputFileType = 'Gnumeric';
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'Gnumeric';
|
// $inputFileType = 'Gnumeric';
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'Gnumeric';
|
// $inputFileType = 'Gnumeric';
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'Gnumeric';
|
// $inputFileType = 'Gnumeric';
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'Gnumeric';
|
// $inputFileType = 'Gnumeric';
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'Gnumeric';
|
// $inputFileType = 'Gnumeric';
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'Gnumeric';
|
// $inputFileType = 'Gnumeric';
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'Gnumeric';
|
// $inputFileType = 'Gnumeric';
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'Gnumeric';
|
// $inputFileType = 'Gnumeric';
|
||||||
|
|
|
@ -27,7 +27,7 @@ include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'Gnumeric';
|
// $inputFileType = 'Gnumeric';
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel2007';
|
$inputFileType = 'Xlsx';
|
||||||
$inputFileName = './sampleData/example1.xlsx';
|
$inputFileName = './sampleData/example1.xlsx';
|
||||||
|
|
||||||
/** Create a new Reader of the type defined in $inputFileType **/
|
/** Create a new Reader of the type defined in $inputFileType **/
|
||||||
|
|
|
@ -26,7 +26,7 @@ set_include_path(get_include_path() . PATH_SEPARATOR . '../../../Classes/');
|
||||||
include 'PHPExcel/IOFactory.php';
|
include 'PHPExcel/IOFactory.php';
|
||||||
|
|
||||||
|
|
||||||
$inputFileType = 'Excel2007';
|
$inputFileType = 'Xlsx';
|
||||||
$inputFileName = './sampleData/example1.xlsx';
|
$inputFileName = './sampleData/example1.xlsx';
|
||||||
|
|
||||||
/** Create a new Reader of the type defined in $inputFileType **/
|
/** Create a new Reader of the type defined in $inputFileType **/
|
||||||
|
|
|
@ -6,6 +6,6 @@ The up-to-date F.A.Q. page for PHPExcel can be found on [http://www.codeplex.com
|
||||||
|
|
||||||
### Formulas don’t seem to be calculated in Excel2003 using compatibility pack?
|
### 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 PHPExcel_Writer_Excel5 if you really need calculated values, or force recalculation in Excel2003.
|
This is normal behaviour of the compatibility pack, Xlsx displays this correctly. Use PHPExcel_Writer_Excel5 if you really need calculated values, or force recalculation in Excel2003.
|
||||||
|
|
||||||
[1]: http://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=FAQ&referringTitle=Requirements
|
[1]: http://www.codeplex.com/PHPExcel/Wiki/View.aspx?title=FAQ&referringTitle=Requirements
|
||||||
|
|
|
@ -299,7 +299,7 @@ DATEVALUE uses the php date/time object implementation of strtotime() (which can
|
||||||
|
|
||||||
__WARNING:-__ PHPExcel accepts a wider range of date formats than MS Excel, so it is entirely possible that Excel will return a #VALUE! error when passed a date string that it can’t interpret, while PHPExcel is able to translate that same string into a correct date value.
|
__WARNING:-__ PHPExcel accepts a wider range of date formats than MS Excel, so it is entirely possible that Excel will return a #VALUE! error when passed a date string that it can’t interpret, while PHPExcel is able to translate that same string into a correct date value.
|
||||||
|
|
||||||
Care should be taken in workbooks that use string formatted dates in calculations when writing to Excel5 or Excel2007.
|
Care should be taken in workbooks that use string formatted dates in calculations when writing to Excel5 or Xlsx.
|
||||||
|
|
||||||
#### DAY
|
#### DAY
|
||||||
|
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
|
|
||||||
## Autofilter Expressions
|
## Autofilter Expressions
|
||||||
|
|
||||||
PHPEXcel 1.7.8 introduced the ability to actually create, read and write filter expressions; initially only for Excel2007 files, but later releases will extend this to other formats.
|
PHPEXcel 1.7.8 introduced the ability to actually create, read and write filter expressions; initially only for Xlsx files, but later releases will extend this to other formats.
|
||||||
|
|
||||||
To apply a filter expression to an autoFilter range, you first need to identify which column you're going to be applying this filter to.
|
To apply a filter expression to an autoFilter range, you first need to identify which column you're going to be applying this filter to.
|
||||||
|
|
||||||
|
|
|
@ -73,19 +73,19 @@ It is necessary to use UTF-8 encoding for all texts in PHPExcel. If the script u
|
||||||
|
|
||||||
Make sure you meet all requirements, especially php_zip extension should be enabled.
|
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). Since version 1.7.6 the PCLZip library has been bundled with PHPExcel as an alternative to the ZipArchive class.
|
The ZipArchive class is only required when reading or writing formats that use Zip compression (Xlsx and OOCalc). Since 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:
|
This can be enabled by calling:
|
||||||
```php
|
```php
|
||||||
PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
|
PHPExcel_Settings::setZipClass(PHPExcel_Settings::PCLZIP);
|
||||||
```
|
```
|
||||||
*before* calling the save method of the Excel2007 Writer.
|
*before* calling the save method of the Xlsx Writer.
|
||||||
|
|
||||||
You can revert to using ZipArchive by calling:
|
You can revert to using ZipArchive by calling:
|
||||||
```php
|
```php
|
||||||
PHPExcel_Settings::setZipClass(PHPExcel_Settings::ZIPARCHIVE);
|
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)
|
At present, this only allows you to write Xlsx files without the need for ZipArchive (not to read Xlsx or OOCalc)
|
||||||
|
|
||||||
##### Excel 2007 cannot open the file generated by PHPExcel_Writer_2007 on Windows
|
##### Excel 2007 cannot open the file generated by PHPExcel_Writer_2007 on Windows
|
||||||
|
|
||||||
|
@ -95,7 +95,7 @@ Some older versions of the 5.2.x php_zip extension on Windows contain an error w
|
||||||
|
|
||||||
Alternatively, upgrading to at least PHP 5.2.9 should solve the problem.
|
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.
|
If you can't locate a clean copy of ZipArchive, then you can use the PCLZip library as an alternative when writing Xlsx files, as described above.
|
||||||
|
|
||||||
##### Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate yyy bytes) in zzz on line aaa
|
##### Fatal error: Allowed memory size of xxx bytes exhausted (tried to allocate yyy bytes) in zzz on line aaa
|
||||||
|
|
||||||
|
@ -122,7 +122,7 @@ We are slowly building up a list of features, together with the different reader
|
||||||
|
|
||||||
##### Formulas don't seem to be calculated in Excel2003 using compatibility pack?
|
##### 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 PHPExcel_Writer_Excel5 if you really need calculated values, or force recalculation in Excel2003.
|
This is normal behaviour of the compatibility pack, Xlsx displays this correctly. Use PHPExcel_Writer_Excel5 if you really need calculated values, or force recalculation in Excel2003.
|
||||||
|
|
||||||
##### Setting column width is not 100% accurate
|
##### Setting column width is not 100% accurate
|
||||||
|
|
||||||
|
@ -177,5 +177,5 @@ Thanks to peterrlynch for the following advice on resolving issues between the [
|
||||||
[21]: http://journal.mycom.co.jp/articles/2009/03/06/phpexcel/index.html
|
[21]: http://journal.mycom.co.jp/articles/2009/03/06/phpexcel/index.html
|
||||||
|
|
||||||
|
|
||||||
[^phpzip_footnote]: __php_zip__ is only needed by __PHPExcel_Reader_Excel2007__, __PHPExcel_Writer_Excel2007__ and __PHPExcel_Reader_OOCalc__. In other words, if you need PHPExcel to handle .xlsx or .ods files you will need the zip extension, but otherwise not.<br />You can remove this dependency for writing Excel2007 files (though not yet for reading) by using the PCLZip library that is bundled with PHPExcel. See the FAQ section of this document for details about this. PCLZip does have a dependency on PHP's zlib extension being enabled.
|
[^phpzip_footnote]: __php_zip__ is only needed by __PHPExcel_Reader_Excel2007__, __PHPExcel_Writer_Excel2007__ and __PHPExcel_Reader_OOCalc__. In other words, if you need PHPExcel to handle .xlsx or .ods files you will need the zip extension, but otherwise not.<br />You can remove this dependency for writing Xlsx files (though not yet for reading) by using the PCLZip library that is bundled with PHPExcel. See the FAQ section of this document for details about this. PCLZip does have a dependency on PHP's zlib extension being enabled.
|
||||||
|
|
||||||
|
|
|
@ -127,7 +127,7 @@ $objPHPExcel->getActiveSheet()->getStyle('A10')
|
||||||
![07-simple-example-1.png](./images/07-simple-example-1.png "")
|
![07-simple-example-1.png](./images/07-simple-example-1.png "")
|
||||||
|
|
||||||
|
|
||||||
**Note** that not all complex format masks such as this one will work when retrieving a formatted value to display "on screen", or for certain writers such as HTML or PDF, but it will work with the true spreadsheet writers (Excel2007 and Excel5).
|
**Note** that not all complex format masks such as this one will work when retrieving a formatted value to display "on screen", or for certain writers such as HTML or PDF, but it will work with the true spreadsheet writers (Xlsx and Excel5).
|
||||||
|
|
||||||
### Setting a range of cells from an array
|
### Setting a range of cells from an array
|
||||||
|
|
||||||
|
@ -266,7 +266,7 @@ The easiest way to loop cells is by using iterators. Using iterators, one can us
|
||||||
Below is an example where we read all the values in a worksheet and display them in a table.
|
Below is an example where we read all the values in a worksheet and display them in a table.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
|
$objReader = PHPExcel_IOFactory::createReader('Xlsx');
|
||||||
$objReader->setReadDataOnly(TRUE);
|
$objReader->setReadDataOnly(TRUE);
|
||||||
$objPHPExcel = $objReader->load("test.xlsx");
|
$objPHPExcel = $objReader->load("test.xlsx");
|
||||||
|
|
||||||
|
@ -304,7 +304,7 @@ Note: In PHPExcel column index is 0-based while row index is 1-based. That means
|
||||||
Below is an example where we read all the values in a worksheet and display them in a table.
|
Below is an example where we read all the values in a worksheet and display them in a table.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
|
$objReader = PHPExcel_IOFactory::createReader('Xlsx');
|
||||||
$objReader->setReadDataOnly(TRUE);
|
$objReader->setReadDataOnly(TRUE);
|
||||||
$objPHPExcel = $objReader->load("test.xlsx");
|
$objPHPExcel = $objReader->load("test.xlsx");
|
||||||
|
|
||||||
|
@ -331,7 +331,7 @@ echo '</table>' . PHP_EOL;
|
||||||
Alternatively, you can take advantage of PHP's "Perl-style" character incrementors to loop through the cells by coordinate:
|
Alternatively, you can take advantage of PHP's "Perl-style" character incrementors to loop through the cells by coordinate:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
|
$objReader = PHPExcel_IOFactory::createReader('Xlsx');
|
||||||
$objReader->setReadDataOnly(TRUE);
|
$objReader->setReadDataOnly(TRUE);
|
||||||
$objPHPExcel = $objReader->load("test.xlsx");
|
$objPHPExcel = $objReader->load("test.xlsx");
|
||||||
|
|
||||||
|
|
|
@ -328,7 +328,7 @@ The first occurrence of the following codes turns the formatting ON, the second
|
||||||
|
|
||||||
Superscript and subscript cannot both be ON at same time. Whichever comes first wins and the other is ignored, while the first is ON.
|
Superscript and subscript cannot both be ON at same time. Whichever comes first wins and the other is ignored, while the first is ON.
|
||||||
|
|
||||||
The following codes are supported by Excel2007:
|
The following codes are supported by Xlsx:
|
||||||
|
|
||||||
Code | Meaning
|
Code | Meaning
|
||||||
-----------------------|-----------
|
-----------------------|-----------
|
||||||
|
@ -545,10 +545,10 @@ $objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()
|
||||||
__Tip__
|
__Tip__
|
||||||
The rules for composing a number format code in Excel can be rather complicated. Sometimes you know how to create some number format in Microsoft Office Excel, but don't know what the underlying number format code looks like. How do you find it?
|
The rules for composing a number format code in Excel can be rather complicated. Sometimes you know how to create some number format in Microsoft Office Excel, but don't know what the underlying number format code looks like. How do you find it?
|
||||||
|
|
||||||
The readers shipped with PHPExcel come to the rescue. Load your template workbook using e.g. Excel2007 reader to reveal the number format code. Example how read a number format code for cell A1:
|
The readers shipped with PHPExcel come to the rescue. Load your template workbook using e.g. Xlsx reader to reveal the number format code. Example how read a number format code for cell A1:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$objReader = PHPExcel_IOFactory::createReader('Excel2007');
|
$objReader = PHPExcel_IOFactory::createReader('Xlsx');
|
||||||
$objPHPExcel = $objReader->load('template.xlsx');
|
$objPHPExcel = $objReader->load('template.xlsx');
|
||||||
var_dump($objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()->getFormatCode());
|
var_dump($objPHPExcel->getActiveSheet()->getStyle('A1')->getNumberFormat()->getFormatCode());
|
||||||
```
|
```
|
||||||
|
@ -745,7 +745,7 @@ $objPHPExcel->getActiveSheet()->getProtection()->setSheet(true);
|
||||||
|
|
||||||
### Setting data validation on a cell
|
### Setting data validation on a cell
|
||||||
|
|
||||||
Data validation is a powerful feature of Excel2007. It allows to specify an input filter on the data that can be inserted in a specific cell. This filter can be a range (i.e. value must be between 0 and 10), a list (i.e. value must be picked from a list), ...
|
Data validation is a powerful feature of Xlsx. It allows to specify an input filter on the data that can be inserted in a specific cell. This filter can be a range (i.e. value must be between 0 and 10), a list (i.e. value must be picked from a list), ...
|
||||||
|
|
||||||
The following piece of code only allows numbers between 10 and 20 to be entered in cell B3:
|
The following piece of code only allows numbers between 10 and 20 to be entered in cell B3:
|
||||||
|
|
||||||
|
@ -1078,7 +1078,7 @@ header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetm
|
||||||
header('Content-Disposition: attachment;filename="myfile.xlsx"');
|
header('Content-Disposition: attachment;filename="myfile.xlsx"');
|
||||||
header('Cache-Control: max-age=0');
|
header('Cache-Control: max-age=0');
|
||||||
|
|
||||||
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
|
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Xlsx');
|
||||||
$objWriter->save('php://output');
|
$objWriter->save('php://output');
|
||||||
```
|
```
|
||||||
|
|
||||||
|
|
|
@ -35,7 +35,7 @@ $objReader->load("05featuredemo.xlsx");
|
||||||
You can create a PHPExcel_Reader_IReader instance using PHPExcel_IOFactory in explicit mode using the following code sample:
|
You can create a PHPExcel_Reader_IReader instance using PHPExcel_IOFactory in explicit mode using the following code sample:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$objReader = PHPExcel_IOFactory::createReader("Excel2007");
|
$objReader = PHPExcel_IOFactory::createReader("Xlsx");
|
||||||
$objPHPExcel = $objReader->load("05featuredemo.xlsx");
|
$objPHPExcel = $objReader->load("05featuredemo.xlsx");
|
||||||
```
|
```
|
||||||
|
|
||||||
|
@ -46,13 +46,13 @@ Note that automatic type resolving mode is slightly slower than explicit mode.
|
||||||
You can create a PHPExcel_Writer_Iwriter instance using PHPExcel_IOFactory:
|
You can create a PHPExcel_Writer_Iwriter instance using PHPExcel_IOFactory:
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, "Excel2007");
|
$objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, "Xlsx");
|
||||||
$objWriter->save("05featuredemo.xlsx");
|
$objWriter->save("05featuredemo.xlsx");
|
||||||
```
|
```
|
||||||
|
|
||||||
### Excel 2007 (SpreadsheetML) file format
|
### Excel 2007 (SpreadsheetML) file format
|
||||||
|
|
||||||
Excel2007 file format is the main file format of PHPExcel. It allows outputting the in-memory spreadsheet to a .xlsx file.
|
Xlsx file format is the main file format of PHPExcel. It allows outputting the in-memory spreadsheet to a .xlsx file.
|
||||||
|
|
||||||
#### PHPExcel_Reader_Excel2007
|
#### PHPExcel_Reader_Excel2007
|
||||||
|
|
||||||
|
@ -131,7 +131,7 @@ $objWriter->save("05featuredemo.xlsx");
|
||||||
|
|
||||||
##### Office 2003 compatibility pack
|
##### Office 2003 compatibility pack
|
||||||
|
|
||||||
Because of a bug in the Office2003 compatibility pack, there can be some small issues when opening Excel2007 spreadsheets (mostly related to formula calculation). You can enable Office2003 compatibility with the following code:
|
Because of a bug in the Office2003 compatibility pack, there can be some small issues when opening Xlsx spreadsheets (mostly related to formula calculation). You can enable Office2003 compatibility with the following code:
|
||||||
|
|
||||||
```
|
```
|
||||||
$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
|
$objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
|
||||||
|
|
|
@ -15,7 +15,7 @@ The Microsoft Excel™ Binary file format (BIFF5 and BIFF8) is a binary file for
|
||||||
|
|
||||||
Microsoft Excel™ 2003 included options for a file format called SpreadsheetML. This file is a zipped XML document. It is not very common, but its core features are supported. Documentation for the format can be found at [http://msdn.microsoft.com/en-us/library/aa140066%28office.10%29.aspx][3] though it’s sadly rather sparse in its detail.
|
Microsoft Excel™ 2003 included options for a file format called SpreadsheetML. This file is a zipped XML document. It is not very common, but its core features are supported. Documentation for the format can be found at [http://msdn.microsoft.com/en-us/library/aa140066%28office.10%29.aspx][3] though it’s sadly rather sparse in its detail.
|
||||||
|
|
||||||
### Excel2007
|
### Xlsx
|
||||||
|
|
||||||
Microsoft Excel™ 2007 shipped with a new file format, namely Microsoft Office Open XML SpreadsheetML, and Excel 2010 extended this still further with its new features such as sparklines. These files typically have an extension of .xlsx. This format is based around a zipped collection of eXtensible Markup Language (XML) files. Microsoft Office Open XML SpreadsheetML is mostly standardized in ECMA 376 ([http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm][4]) and ISO 29500.
|
Microsoft Excel™ 2007 shipped with a new file format, namely Microsoft Office Open XML SpreadsheetML, and Excel 2010 extended this still further with its new features such as sparklines. These files typically have an extension of .xlsx. This format is based around a zipped collection of eXtensible Markup Language (XML) files. Microsoft Office Open XML SpreadsheetML is mostly standardized in ECMA 376 ([http://www.ecma-international.org/news/TC45_current_work/TC45_available_docs.htm][4]) and ISO 29500.
|
||||||
|
|
||||||
|
|
|
@ -25,7 +25,7 @@ Alternatively, you can use the IO Factory's createReader() method to instantiate
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$inputFileType = 'Excel5';
|
$inputFileType = 'Excel5';
|
||||||
// $inputFileType = 'Excel2007';
|
// $inputFileType = 'Xlsx';
|
||||||
// $inputFileType = 'Excel2003XML';
|
// $inputFileType = 'Excel2003XML';
|
||||||
// $inputFileType = 'OOCalc';
|
// $inputFileType = 'OOCalc';
|
||||||
// $inputFileType = 'SYLK';
|
// $inputFileType = 'SYLK';
|
||||||
|
|
|
@ -29,7 +29,7 @@ Reading Only Data from a Spreadsheet File applies to Readers:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Excel2007 | YES | Excel5 | YES | Excel2003XML | YES |
|
Xlsx | YES | Excel5 | YES | Excel2003XML | YES |
|
||||||
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
||||||
CSV | NO | HTML | NO
|
CSV | NO | HTML | NO
|
||||||
|
|
||||||
|
@ -88,7 +88,7 @@ Reading Only Named WorkSheets from a File applies to Readers:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Excel2007 | YES | Excel5 | YES | Excel2003XML | YES |
|
Xlsx | YES | Excel5 | YES | Excel2003XML | YES |
|
||||||
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
||||||
CSV | NO | HTML | NO
|
CSV | NO | HTML | NO
|
||||||
|
|
||||||
|
@ -217,7 +217,7 @@ Using Read Filters applies to:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Excel2007 | YES | Excel5 | YES | Excel2003XML | YES |
|
Xlsx | YES | Excel5 | YES | Excel2003XML | YES |
|
||||||
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
OOCalc | YES | SYLK | NO | Gnumeric | YES |
|
||||||
CSV | YES | HTML | NO
|
CSV | YES | HTML | NO
|
||||||
|
|
||||||
|
@ -264,13 +264,13 @@ Combining Multiple Files into a Single PHPExcel Object applies to:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Excel2007 | NO | Excel5 | NO | Excel2003XML | NO |
|
Xlsx | NO | Excel5 | NO | Excel2003XML | NO |
|
||||||
OOCalc | NO | SYLK | YES | Gnumeric | NO |
|
OOCalc | NO | SYLK | YES | Gnumeric | NO |
|
||||||
CSV | YES | HTML | NO
|
CSV | YES | HTML | NO
|
||||||
|
|
||||||
### Combining Read Filters with the setSheetIndex() method to split a large CSV file across multiple Worksheets
|
### Combining Read Filters with the setSheetIndex() method to split a large CSV file across multiple Worksheets
|
||||||
|
|
||||||
An Excel5 BIFF .xls file is limited to 65536 rows in a worksheet, while the Excel2007 Microsoft Office Open XML SpreadsheetML .xlsx file is limited to 1,048,576 rows in a worksheet; but a CSV file is not limited other than by available disk space. This means that we wouldn’t ordinarily be able to read all the rows from a very large CSV file that exceeded those limits, and save it as an Excel5 or Excel2007 file. However, by using Read Filters to read the CSV file in “chunks” (using the chunkReadFilter Class that we defined in section REF _Ref275604563 \r \p 5.3 above), and the setSheetIndex() method of the $objReader, we can split the CSV file across several individual worksheets.
|
An Excel5 BIFF .xls file is limited to 65536 rows in a worksheet, while the Xlsx Microsoft Office Open XML SpreadsheetML .xlsx file is limited to 1,048,576 rows in a worksheet; but a CSV file is not limited other than by available disk space. This means that we wouldn’t ordinarily be able to read all the rows from a very large CSV file that exceeded those limits, and save it as an Excel5 or Xlsx file. However, by using Read Filters to read the CSV file in “chunks” (using the chunkReadFilter Class that we defined in section REF _Ref275604563 \r \p 5.3 above), and the setSheetIndex() method of the $objReader, we can split the CSV file across several individual worksheets.
|
||||||
|
|
||||||
```php
|
```php
|
||||||
$inputFileType = 'CSV';
|
$inputFileType = 'CSV';
|
||||||
|
@ -325,7 +325,7 @@ Splitting a single loaded file across multiple worksheets applies to:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Excel2007 | NO | Excel5 | NO | Excel2003XML | NO |
|
Xlsx | NO | Excel5 | NO | Excel2003XML | NO |
|
||||||
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
||||||
CSV | YES | HTML | NO
|
CSV | YES | HTML | NO
|
||||||
|
|
||||||
|
@ -357,7 +357,7 @@ Setting CSV delimiter applies to:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Excel2007 | NO | Excel5 | NO | Excel2003XML | NO |
|
Xlsx | NO | Excel5 | NO | Excel2003XML | NO |
|
||||||
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
||||||
CSV | YES | HTML | NO
|
CSV | YES | HTML | NO
|
||||||
|
|
||||||
|
@ -386,7 +386,7 @@ Loading using a Value Binder applies to:
|
||||||
|
|
||||||
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
Reader | Y/N |Reader | Y/N |Reader | Y/N |
|
||||||
----------|:---:|--------|:---:|--------------|:---:|
|
----------|:---:|--------|:---:|--------------|:---:|
|
||||||
Excel2007 | NO | Excel5 | NO | Excel2003XML | NO |
|
Xlsx | NO | Excel5 | NO | Excel2003XML | NO |
|
||||||
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
OOCalc | NO | SYLK | NO | Gnumeric | NO |
|
||||||
CSV | YES | HTML | YES
|
CSV | YES | HTML | YES
|
||||||
|
|
||||||
|
|
|
@ -41,10 +41,10 @@ $spreadsheet->getActiveSheet()->setTitle('Simple');
|
||||||
$spreadsheet->setActiveSheetIndex(0);
|
$spreadsheet->setActiveSheetIndex(0);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$helper->log('Write to Excel2007 format');
|
$helper->log('Write to Xlsx format');
|
||||||
|
|
||||||
// Use PCLZip rather than ZipArchive to create the Excel2007 OfficeOpenXML file
|
// Use PCLZip rather than ZipArchive to create the Xlsx OfficeOpenXML file
|
||||||
\PhpOffice\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::PCLZIP);
|
\PhpOffice\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::PCLZIP);
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
$helper->write($spreadsheet, __FILE__, ['Excel2007' => 'xlsx']);
|
$helper->write($spreadsheet, __FILE__, ['Xlsx' => 'xlsx']);
|
||||||
|
|
|
@ -38,7 +38,7 @@ $spreadsheet->getActiveSheet()->setTitle('Simple');
|
||||||
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
|
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
|
||||||
$spreadsheet->setActiveSheetIndex(0);
|
$spreadsheet->setActiveSheetIndex(0);
|
||||||
|
|
||||||
// Redirect output to a client’s web browser (Excel2007)
|
// Redirect output to a client’s web browser (Xlsx)
|
||||||
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
|
||||||
header('Content-Disposition: attachment;filename="01simple.xlsx"');
|
header('Content-Disposition: attachment;filename="01simple.xlsx"');
|
||||||
header('Cache-Control: max-age=0');
|
header('Cache-Control: max-age=0');
|
||||||
|
@ -51,6 +51,6 @@ header('Last-Modified: ' . gmdate('D, d M Y H:i:s') . ' GMT'); // always modifie
|
||||||
header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
|
header('Cache-Control: cache, must-revalidate'); // HTTP/1.1
|
||||||
header('Pragma: public'); // HTTP/1.0
|
header('Pragma: public'); // HTTP/1.0
|
||||||
|
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->save('php://output');
|
$writer->save('php://output');
|
||||||
exit;
|
exit;
|
||||||
|
|
|
@ -71,7 +71,7 @@ $spreadsheet->getActiveSheet()
|
||||||
// If we set Pre Calculated Formulas to true then PhpSpreadsheet will calculate all formulae in the
|
// If we set Pre Calculated Formulas to true then PhpSpreadsheet will calculate all formulae in the
|
||||||
// workbook before saving. This adds time and memory overhead, and can cause some problems with formulae
|
// workbook before saving. This adds time and memory overhead, and can cause some problems with formulae
|
||||||
// using functions or features (such as array formulae) that aren't yet supported by the calculation engine
|
// using functions or features (such as array formulae) that aren't yet supported by the calculation engine
|
||||||
// If the value is false (the default) for the Excel2007 Writer, then MS Excel (or the application used to
|
// If the value is false (the default) for the Xlsx Writer, then MS Excel (or the application used to
|
||||||
// open the file) will need to recalculate values itself to guarantee that the correct results are available.
|
// open the file) will need to recalculate values itself to guarantee that the correct results are available.
|
||||||
//
|
//
|
||||||
//$writer->setPreCalculateFormulas(true);
|
//$writer->setPreCalculateFormulas(true);
|
||||||
|
|
|
@ -5,12 +5,12 @@ require __DIR__ . '/Header.php';
|
||||||
// Create temporary file that will be read
|
// Create temporary file that will be read
|
||||||
$sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
|
$sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
|
||||||
$filename = $helper->getTemporaryFilename();
|
$filename = $helper->getTemporaryFilename();
|
||||||
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet);
|
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($sampleSpreadsheet);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
|
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
|
||||||
$helper->logRead('Excel2007', $filename, $callStartTime);
|
$helper->logRead('Xlsx', $filename, $callStartTime);
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
$helper->write($spreadsheet, __FILE__);
|
$helper->write($spreadsheet, __FILE__);
|
||||||
|
|
|
@ -5,15 +5,15 @@ require __DIR__ . '/Header.php';
|
||||||
// Create temporary file that will be read
|
// Create temporary file that will be read
|
||||||
$sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
|
$sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
|
||||||
$filename = $helper->getTemporaryFilename();
|
$filename = $helper->getTemporaryFilename();
|
||||||
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet);
|
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($sampleSpreadsheet);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
||||||
// Use PCLZip rather than ZipArchive to read the Excel2007 OfficeOpenXML file
|
// Use PCLZip rather than ZipArchive to read the Xlsx OfficeOpenXML file
|
||||||
\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::PCLZIP);
|
\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::PCLZIP);
|
||||||
|
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
|
$spreadsheet = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
|
||||||
$helper->logRead('Excel2007', $filename, $callStartTime);
|
$helper->logRead('Xlsx', $filename, $callStartTime);
|
||||||
$callEndTime = microtime(true);
|
$callEndTime = microtime(true);
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
|
|
|
@ -166,7 +166,7 @@ for ($col = 'B'; $col != 'G'; ++$col) {
|
||||||
// If we set Pre Calculated Formulas to true then PhpSpreadsheet will calculate all formulae in the
|
// If we set Pre Calculated Formulas to true then PhpSpreadsheet will calculate all formulae in the
|
||||||
// workbook before saving. This adds time and memory overhead, and can cause some problems with formulae
|
// workbook before saving. This adds time and memory overhead, and can cause some problems with formulae
|
||||||
// using functions or features (such as array formulae) that aren't yet supported by the calculation engine
|
// using functions or features (such as array formulae) that aren't yet supported by the calculation engine
|
||||||
// If the value is false (the default) for the Excel2007 Writer, then MS Excel (or the application used to
|
// If the value is false (the default) for the Xlsx Writer, then MS Excel (or the application used to
|
||||||
// open the file) will need to recalculate values itself to guarantee that the correct results are available.
|
// open the file) will need to recalculate values itself to guarantee that the correct results are available.
|
||||||
//
|
//
|
||||||
//$writer->setPreCalculateFormulas(true);
|
//$writer->setPreCalculateFormulas(true);
|
||||||
|
|
|
@ -23,8 +23,8 @@ $callStartTime = microtime(true);
|
||||||
$spreadsheetFromCSV = $reader->load($filename);
|
$spreadsheetFromCSV = $reader->load($filename);
|
||||||
$helper->logRead('CSV', $filename, $callStartTime);
|
$helper->logRead('CSV', $filename, $callStartTime);
|
||||||
|
|
||||||
// Write Excel2007
|
// Write Xlsx
|
||||||
$helper->write($spreadsheetFromCSV, __FILE__, ['Excel2007' => 'xlsx']);
|
$helper->write($spreadsheetFromCSV, __FILE__, ['Xlsx' => 'xlsx']);
|
||||||
|
|
||||||
// Write CSV
|
// Write CSV
|
||||||
$filenameCSV = $helper->getFilename(__FILE__, 'csv');
|
$filenameCSV = $helper->getFilename(__FILE__, 'csv');
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require __DIR__ . '/Header.php';
|
require __DIR__ . '/Header.php';
|
||||||
|
|
||||||
// Use PCLZip rather than ZipArchive to read the Excel2007 OfficeOpenXML file
|
// Use PCLZip rather than ZipArchive to read the Xlsx OfficeOpenXML file
|
||||||
\PhpOffice\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::PCLZIP);
|
\PhpOffice\PhpSpreadsheet\Settings::setZipClass(\PhpOffice\PhpSpreadsheet\Settings::PCLZIP);
|
||||||
|
|
||||||
$filename = __DIR__ . '/templates/OOCalcTest.ods';
|
$filename = __DIR__ . '/templates/OOCalcTest.ods';
|
||||||
|
|
|
@ -6,7 +6,7 @@ require __DIR__ . '/Header.php';
|
||||||
|
|
||||||
// Write temporary file
|
// Write temporary file
|
||||||
$largeSpreadsheet = require __DIR__ . '/templates/largeSpreadsheet.php';
|
$largeSpreadsheet = require __DIR__ . '/templates/largeSpreadsheet.php';
|
||||||
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($largeSpreadsheet);
|
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($largeSpreadsheet);
|
||||||
$filename = $helper->getTemporaryFilename();
|
$filename = $helper->getTemporaryFilename();
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
@ -25,12 +25,12 @@ class MyReadFilter implements \PhpOffice\PhpSpreadsheet\Reader\IReadFilter
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
$helper->log('Load from Excel2007 file');
|
$helper->log('Load from Xlsx file');
|
||||||
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel2007');
|
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
|
||||||
$reader->setReadFilter(new MyReadFilter());
|
$reader->setReadFilter(new MyReadFilter());
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$spreadsheet = $reader->load($filename);
|
$spreadsheet = $reader->load($filename);
|
||||||
$helper->logRead('Excel2007', $filename, $callStartTime);
|
$helper->logRead('Xlsx', $filename, $callStartTime);
|
||||||
$helper->log('Remove unnecessary rows');
|
$helper->log('Remove unnecessary rows');
|
||||||
$spreadsheet->getActiveSheet()->removeRow(2, 18);
|
$spreadsheet->getActiveSheet()->removeRow(2, 18);
|
||||||
|
|
||||||
|
|
|
@ -34,4 +34,4 @@ $drawing->setHeight(36);
|
||||||
$drawing->setWorksheet($spreadsheet->getActiveSheet());
|
$drawing->setWorksheet($spreadsheet->getActiveSheet());
|
||||||
|
|
||||||
// Save
|
// Save
|
||||||
$helper->write($spreadsheet, __FILE__, ['Excel2007' => 'xlsx', 'HTML' => 'html']);
|
$helper->write($spreadsheet, __FILE__, ['Xlsx' => 'xlsx', 'HTML' => 'html']);
|
||||||
|
|
|
@ -12,13 +12,13 @@ $rendererName = \PhpOffice\PhpSpreadsheet\Settings::PDF_RENDERER_DOMPDF;
|
||||||
$rendererLibrary = 'domPDF0.6.0beta3';
|
$rendererLibrary = 'domPDF0.6.0beta3';
|
||||||
$rendererLibraryPath = '/php/libraries/PDF/' . $rendererLibrary;
|
$rendererLibraryPath = '/php/libraries/PDF/' . $rendererLibrary;
|
||||||
|
|
||||||
// Read from Excel2007 (.xlsx) template
|
// Read from Xlsx (.xlsx) template
|
||||||
$helper->log('Load Excel2007 template file');
|
$helper->log('Load Xlsx template file');
|
||||||
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel2007');
|
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
|
||||||
$spreadsheet = $reader->load(__DIR__ . '/templates/26template.xlsx');
|
$spreadsheet = $reader->load(__DIR__ . '/templates/26template.xlsx');
|
||||||
|
|
||||||
/* at this point, we could do some manipulations with the template, but we skip this step */
|
/* at this point, we could do some manipulations with the template, but we skip this step */
|
||||||
$helper->write($spreadsheet, __FILE__, ['Excel2007' => 'xlsx', 'Excel5' => 'xls', 'HTML' => 'html']);
|
$helper->write($spreadsheet, __FILE__, ['Xlsx' => 'xlsx', 'Excel5' => 'xls', 'HTML' => 'html']);
|
||||||
|
|
||||||
// Export to PDF (.pdf)
|
// Export to PDF (.pdf)
|
||||||
$helper->log('Write to PDF format');
|
$helper->log('Write to PDF format');
|
||||||
|
|
|
@ -3,7 +3,7 @@
|
||||||
require __DIR__ . '/Header.php';
|
require __DIR__ . '/Header.php';
|
||||||
|
|
||||||
// Read from Excel5 (.xls) template
|
// Read from Excel5 (.xls) template
|
||||||
$helper->log('Load Excel2007 template file');
|
$helper->log('Load Xlsx template file');
|
||||||
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel5');
|
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel5');
|
||||||
$spreadsheet = $reader->load(__DIR__ . '/templates/27template.xls');
|
$spreadsheet = $reader->load(__DIR__ . '/templates/27template.xls');
|
||||||
|
|
||||||
|
|
|
@ -4,15 +4,15 @@ require __DIR__ . '/Header.php';
|
||||||
|
|
||||||
$sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
|
$sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
|
||||||
$filename = $helper->getTemporaryFilename();
|
$filename = $helper->getTemporaryFilename();
|
||||||
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet);
|
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($sampleSpreadsheet);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
$helper->logWrite($writer, $filename, $callStartTime);
|
$helper->logWrite($writer, $filename, $callStartTime);
|
||||||
|
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel2007');
|
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
|
||||||
$spreadsheet = $reader->load($filename);
|
$spreadsheet = $reader->load($filename);
|
||||||
$helper->logRead('Excel2007', $filename, $callStartTime);
|
$helper->logRead('Xlsx', $filename, $callStartTime);
|
||||||
$helper->log('Iterate worksheets');
|
$helper->log('Iterate worksheets');
|
||||||
foreach ($spreadsheet->getWorksheetIterator() as $worksheet) {
|
foreach ($spreadsheet->getWorksheetIterator() as $worksheet) {
|
||||||
$helper->log('Worksheet - ' . $worksheet->getTitle());
|
$helper->log('Worksheet - ' . $worksheet->getTitle());
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require __DIR__ . '/Header.php';
|
require __DIR__ . '/Header.php';
|
||||||
|
|
||||||
$inputFileType = 'Excel2007';
|
$inputFileType = 'Xlsx';
|
||||||
$inputFileName = __DIR__ . '/templates/31docproperties.xlsx';
|
$inputFileName = __DIR__ . '/templates/31docproperties.xlsx';
|
||||||
|
|
||||||
$spreadsheetReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
$spreadsheetReader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader($inputFileType);
|
||||||
|
@ -18,7 +18,7 @@ $spreadsheet->getProperties()->setTitle('Office 2007 XLSX Test Document')
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
$helper->logWrite($writer, $filename, $callStartTime);
|
$helper->logWrite($writer, $filename, $callStartTime);
|
||||||
|
@ -27,7 +27,7 @@ $helper->logWrite($writer, $filename, $callStartTime);
|
||||||
$helper->logEndingNotes();
|
$helper->logEndingNotes();
|
||||||
|
|
||||||
// Reread File
|
// Reread File
|
||||||
$helper->log('Reread Excel2007 file');
|
$helper->log('Reread Xlsx file');
|
||||||
$spreadsheetRead = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
|
$spreadsheetRead = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename);
|
||||||
|
|
||||||
// Set properties
|
// Set properties
|
||||||
|
|
|
@ -2,7 +2,7 @@
|
||||||
|
|
||||||
require __DIR__ . '/Header.php';
|
require __DIR__ . '/Header.php';
|
||||||
|
|
||||||
$inputFileType = 'Excel2007';
|
$inputFileType = 'Xlsx';
|
||||||
$inputFileNames = __DIR__ . '/templates/32readwrite*[0-9].xlsx';
|
$inputFileNames = __DIR__ . '/templates/32readwrite*[0-9].xlsx';
|
||||||
|
|
||||||
if ((isset($argc)) && ($argc > 1)) {
|
if ((isset($argc)) && ($argc > 1)) {
|
||||||
|
@ -69,7 +69,7 @@ foreach ($inputFileNames as $inputFileName) {
|
||||||
}
|
}
|
||||||
|
|
||||||
$outputFileName = $helper->getFilename($inputFileName);
|
$outputFileName = $helper->getFilename($inputFileName);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($outputFileName);
|
$writer->save($outputFileName);
|
||||||
|
|
|
@ -14,7 +14,7 @@ if (!\PhpOffice\PhpSpreadsheet\Settings::setChartRenderer($rendererName, $render
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$inputFileType = 'Excel2007';
|
$inputFileType = 'Xlsx';
|
||||||
$inputFileNames = __DIR__ . '/templates/36write*.xlsx';
|
$inputFileNames = __DIR__ . '/templates/36write*.xlsx';
|
||||||
|
|
||||||
if ((isset($argc)) && ($argc > 1)) {
|
if ((isset($argc)) && ($argc > 1)) {
|
||||||
|
|
|
@ -30,7 +30,7 @@ if (!\PhpOffice\PhpSpreadsheet\Settings::setChartRenderer($rendererName, $render
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$inputFileType = 'Excel2007';
|
$inputFileType = 'Xlsx';
|
||||||
$inputFileNames = __DIR__ . '/templates/36write*.xlsx';
|
$inputFileNames = __DIR__ . '/templates/36write*.xlsx';
|
||||||
|
|
||||||
if ((isset($argc)) && ($argc > 1)) {
|
if ((isset($argc)) && ($argc > 1)) {
|
||||||
|
|
|
@ -89,7 +89,7 @@ $worksheet->addChart($chart);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -7,7 +7,7 @@ $spreadsheet = require __DIR__ . '/templates/chartSpreadsheet.php';
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -92,7 +92,7 @@ $worksheet->addChart($chart);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -92,7 +92,7 @@ $worksheet->addChart($chart);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -101,7 +101,7 @@ $worksheet->addChart($chart);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -145,7 +145,7 @@ $worksheet->addChart($chart);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -89,7 +89,7 @@ $worksheet->addChart($chart);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -164,7 +164,7 @@ $worksheet->addChart($chart2);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -159,7 +159,7 @@ $worksheet->addChart($chart2);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -101,7 +101,7 @@ $worksheet->addChart($chart);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -86,7 +86,7 @@ $worksheet->addChart($chart);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -97,7 +97,7 @@ $worksheet->addChart($chart);
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -6,11 +6,11 @@ require __DIR__ . '/Header.php';
|
||||||
// Create temporary file that will be read
|
// Create temporary file that will be read
|
||||||
$sampleSpreadsheet = require __DIR__ . '/templates/chartSpreadsheet.php';
|
$sampleSpreadsheet = require __DIR__ . '/templates/chartSpreadsheet.php';
|
||||||
$filename = $helper->getTemporaryFilename();
|
$filename = $helper->getTemporaryFilename();
|
||||||
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet);
|
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($sampleSpreadsheet);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
||||||
$helper->log('Load from Excel2007 file');
|
$helper->log('Load from Xlsx file');
|
||||||
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Excel2007');
|
$reader = \PhpOffice\PhpSpreadsheet\IOFactory::createReader('Xlsx');
|
||||||
$reader->setIncludeCharts(true);
|
$reader->setIncludeCharts(true);
|
||||||
$spreadsheet = $reader->load($filename);
|
$spreadsheet = $reader->load($filename);
|
||||||
|
|
||||||
|
@ -29,7 +29,7 @@ $worksheet->fromArray(
|
||||||
|
|
||||||
// Save Excel 2007 file
|
// Save Excel 2007 file
|
||||||
$filename = $helper->getFilename(__FILE__);
|
$filename = $helper->getFilename(__FILE__);
|
||||||
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Excel2007');
|
$writer = \PhpOffice\PhpSpreadsheet\IOFactory::createWriter($spreadsheet, 'Xlsx');
|
||||||
$writer->setIncludeCharts(true);
|
$writer->setIncludeCharts(true);
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
|
@ -14,7 +14,7 @@ if (!\PhpOffice\PhpSpreadsheet\Settings::setChartRenderer($rendererName, $render
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
$inputFileType = 'Excel2007';
|
$inputFileType = 'Xlsx';
|
||||||
$inputFileNames = __DIR__ . '/templates/32readwrite*[0-9].xlsx';
|
$inputFileNames = __DIR__ . '/templates/32readwrite*[0-9].xlsx';
|
||||||
|
|
||||||
if ((isset($argc)) && ($argc > 1)) {
|
if ((isset($argc)) && ($argc > 1)) {
|
||||||
|
|
|
@ -2,17 +2,17 @@
|
||||||
|
|
||||||
require __DIR__ . '/Header.php';
|
require __DIR__ . '/Header.php';
|
||||||
|
|
||||||
$helper->log('Load MergeBook1 from Excel2007 file');
|
$helper->log('Load MergeBook1 from Xlsx file');
|
||||||
$filename1 = __DIR__ . '/templates/43mergeBook1.xlsx';
|
$filename1 = __DIR__ . '/templates/43mergeBook1.xlsx';
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$spreadsheet1 = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename1);
|
$spreadsheet1 = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename1);
|
||||||
$helper->logRead('Excel2007', $filename1, $callStartTime);
|
$helper->logRead('Xlsx', $filename1, $callStartTime);
|
||||||
|
|
||||||
$helper->log('Load MergeBook2 from Excel2007 file');
|
$helper->log('Load MergeBook2 from Xlsx file');
|
||||||
$filename2 = __DIR__ . '/templates/43mergeBook2.xlsx';
|
$filename2 = __DIR__ . '/templates/43mergeBook2.xlsx';
|
||||||
$callStartTime = microtime(true);
|
$callStartTime = microtime(true);
|
||||||
$spreadsheet2 = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename2);
|
$spreadsheet2 = \PhpOffice\PhpSpreadsheet\IOFactory::load($filename2);
|
||||||
$helper->logRead('Excel2007', $filename2, $callStartTime);
|
$helper->logRead('Xlsx', $filename2, $callStartTime);
|
||||||
|
|
||||||
foreach ($spreadsheet2->getSheetNames() as $sheetName) {
|
foreach ($spreadsheet2->getSheetNames() as $sheetName) {
|
||||||
$sheet = $spreadsheet2->getSheetByName($sheetName);
|
$sheet = $spreadsheet2->getSheetByName($sheetName);
|
||||||
|
|
|
@ -5,7 +5,7 @@ require __DIR__ . '/Header.php';
|
||||||
// Create temporary file that will be read
|
// Create temporary file that will be read
|
||||||
$sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
|
$sampleSpreadsheet = require __DIR__ . '/templates/sampleSpreadsheet.php';
|
||||||
$filename = $helper->getTemporaryFilename();
|
$filename = $helper->getTemporaryFilename();
|
||||||
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Excel2007($sampleSpreadsheet);
|
$writer = new \PhpOffice\PhpSpreadsheet\Writer\Xlsx($sampleSpreadsheet);
|
||||||
$writer->save($filename);
|
$writer->save($filename);
|
||||||
|
|
||||||
$inputFileType = \PhpOffice\PhpSpreadsheet\IOFactory::identify($filename);
|
$inputFileType = \PhpOffice\PhpSpreadsheet\IOFactory::identify($filename);
|
||||||
|
|
|
@ -78,7 +78,7 @@ class Sample
|
||||||
* @param string $filename
|
* @param string $filename
|
||||||
* @param array $writers
|
* @param array $writers
|
||||||
*/
|
*/
|
||||||
public function write(Spreadsheet $spreadsheet, $filename, array $writers = ['Excel2007' => 'xlsx', 'Excel5' => 'xls'])
|
public function write(Spreadsheet $spreadsheet, $filename, array $writers = ['Xlsx' => 'xlsx', 'Excel5' => 'xls'])
|
||||||
{
|
{
|
||||||
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
|
// Set active sheet index to the first sheet, so Excel opens this as the first sheet
|
||||||
$spreadsheet->setActiveSheetIndex(0);
|
$spreadsheet->setActiveSheetIndex(0);
|
||||||
|
|
|
@ -44,7 +44,7 @@ class IOFactory
|
||||||
* @static
|
* @static
|
||||||
*/
|
*/
|
||||||
private static $autoResolveClasses = [
|
private static $autoResolveClasses = [
|
||||||
'Excel2007',
|
'Xlsx',
|
||||||
'Excel5',
|
'Excel5',
|
||||||
'Excel2003XML',
|
'Excel2003XML',
|
||||||
'OOCalc',
|
'OOCalc',
|
||||||
|
@ -106,7 +106,7 @@ class IOFactory
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @param Spreadsheet $spreadsheet
|
* @param Spreadsheet $spreadsheet
|
||||||
* @param string $writerType Example: Excel2007
|
* @param string $writerType Example: Xlsx
|
||||||
* @throws Writer\Exception
|
* @throws Writer\Exception
|
||||||
* @return Writer\IWriter
|
* @return Writer\IWriter
|
||||||
*/
|
*/
|
||||||
|
@ -135,7 +135,7 @@ class IOFactory
|
||||||
* Create Reader\IReader
|
* Create Reader\IReader
|
||||||
*
|
*
|
||||||
* @static
|
* @static
|
||||||
* @param string $readerType Example: Excel2007
|
* @param string $readerType Example: Xlsx
|
||||||
* @throws Reader\Exception
|
* @throws Reader\Exception
|
||||||
* @return Reader\IReader
|
* @return Reader\IReader
|
||||||
*/
|
*/
|
||||||
|
@ -213,7 +213,7 @@ class IOFactory
|
||||||
case 'xlsm': // Excel (OfficeOpenXML) Macro Spreadsheet (macros will be discarded)
|
case 'xlsm': // Excel (OfficeOpenXML) Macro Spreadsheet (macros will be discarded)
|
||||||
case 'xltx': // Excel (OfficeOpenXML) Template
|
case 'xltx': // Excel (OfficeOpenXML) Template
|
||||||
case 'xltm': // Excel (OfficeOpenXML) Macro Template (macros will be discarded)
|
case 'xltm': // Excel (OfficeOpenXML) Macro Template (macros will be discarded)
|
||||||
$extensionType = 'Excel2007';
|
$extensionType = 'Xlsx';
|
||||||
break;
|
break;
|
||||||
case 'xls': // Excel (BIFF) Spreadsheet
|
case 'xls': // Excel (BIFF) Spreadsheet
|
||||||
case 'xlt': // Excel (BIFF) Template
|
case 'xlt': // Excel (BIFF) Template
|
||||||
|
|
|
@ -24,7 +24,7 @@ namespace PhpOffice\PhpSpreadsheet\Reader;
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class Excel2007 extends BaseReader implements IReader
|
class Xlsx extends BaseReader implements IReader
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* ReferenceHelper instance
|
* ReferenceHelper instance
|
||||||
|
@ -34,14 +34,14 @@ class Excel2007 extends BaseReader implements IReader
|
||||||
private $referenceHelper = null;
|
private $referenceHelper = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Excel2007\Theme instance
|
* Xlsx\Theme instance
|
||||||
*
|
*
|
||||||
* @var Excel2007\Theme
|
* @var Xlsx\Theme
|
||||||
*/
|
*/
|
||||||
private static $theme = null;
|
private static $theme = null;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new Excel2007 Reader instance
|
* Create a new Xlsx Reader instance
|
||||||
*/
|
*/
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
|
@ -398,7 +398,7 @@ class Excel2007 extends BaseReader implements IReader
|
||||||
$themeColours[$themePos] = $xmlColourData['val'];
|
$themeColours[$themePos] = $xmlColourData['val'];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
self::$theme = new Excel2007\Theme($themeName, $colourSchemeName, $themeColours);
|
self::$theme = new Xlsx\Theme($themeName, $colourSchemeName, $themeColours);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -1827,7 +1827,7 @@ class Excel2007 extends BaseReader implements IReader
|
||||||
'SimpleXMLElement',
|
'SimpleXMLElement',
|
||||||
\PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
|
\PhpOffice\PhpSpreadsheet\Settings::getLibXmlLoaderOptions()
|
||||||
);
|
);
|
||||||
$objChart = \PhpOffice\PhpSpreadsheet\Reader\Excel2007\Chart::readChart($chartElements, basename($chartEntryRef, '.xml'));
|
$objChart = \PhpOffice\PhpSpreadsheet\Reader\Xlsx\Chart::readChart($chartElements, basename($chartEntryRef, '.xml'));
|
||||||
|
|
||||||
if (isset($charts[$chartEntryRef])) {
|
if (isset($charts[$chartEntryRef])) {
|
||||||
$chartPositionRef = $charts[$chartEntryRef]['sheet'] . '!' . $charts[$chartEntryRef]['id'];
|
$chartPositionRef = $charts[$chartEntryRef]['sheet'] . '!' . $charts[$chartEntryRef]['id'];
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Reader\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Reader\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -177,11 +177,11 @@ class OpenDocument extends BaseWriter implements IWriter
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Set PhpSpreadsheet object
|
* Set Spreadsheet object
|
||||||
*
|
*
|
||||||
* @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object
|
* @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object
|
||||||
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
* @throws \PhpOffice\PhpSpreadsheet\Writer\Exception
|
||||||
* @return Excel2007
|
* @return self
|
||||||
*/
|
*/
|
||||||
public function setSpreadsheet(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null)
|
public function setSpreadsheet(\PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet = null)
|
||||||
{
|
{
|
||||||
|
|
|
@ -24,6 +24,6 @@ namespace PhpOffice\PhpSpreadsheet\Writer\OpenDocument;
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
abstract class WriterPart extends \PhpOffice\PhpSpreadsheet\Writer\Excel2007\WriterPart
|
abstract class WriterPart extends \PhpOffice\PhpSpreadsheet\Writer\Xlsx\WriterPart
|
||||||
{
|
{
|
||||||
}
|
}
|
||||||
|
|
|
@ -26,7 +26,7 @@ use PhpOffice\PhpSpreadsheet\Spreadsheet;
|
||||||
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
* @license http://www.gnu.org/licenses/old-licenses/lgpl-2.1.txt LGPL
|
||||||
* @version ##VERSION##, ##DATE##
|
* @version ##VERSION##, ##DATE##
|
||||||
*/
|
*/
|
||||||
class Excel2007 extends BaseWriter implements IWriter
|
class Xlsx extends BaseWriter implements IWriter
|
||||||
{
|
{
|
||||||
/**
|
/**
|
||||||
* Office2003 compatibility
|
* Office2003 compatibility
|
||||||
|
@ -38,7 +38,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
/**
|
/**
|
||||||
* Private writer parts
|
* Private writer parts
|
||||||
*
|
*
|
||||||
* @var Excel2007\WriterPart[]
|
* @var Xlsx\WriterPart[]
|
||||||
*/
|
*/
|
||||||
private $writerParts = [];
|
private $writerParts = [];
|
||||||
|
|
||||||
|
@ -106,7 +106,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
private $drawingHashTable;
|
private $drawingHashTable;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Create a new Excel2007 Writer
|
* Create a new Xlsx Writer
|
||||||
*
|
*
|
||||||
* @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet
|
* @param \PhpOffice\PhpSpreadsheet\SpreadSheet $spreadsheet
|
||||||
*/
|
*/
|
||||||
|
@ -116,19 +116,19 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
$this->setSpreadsheet($spreadsheet);
|
$this->setSpreadsheet($spreadsheet);
|
||||||
|
|
||||||
$writerPartsArray = [
|
$writerPartsArray = [
|
||||||
'stringtable' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\StringTable',
|
'stringtable' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\StringTable',
|
||||||
'contenttypes' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\ContentTypes',
|
'contenttypes' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\ContentTypes',
|
||||||
'docprops' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\DocProps',
|
'docprops' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\DocProps',
|
||||||
'rels' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Rels',
|
'rels' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Rels',
|
||||||
'theme' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Theme',
|
'theme' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Theme',
|
||||||
'style' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Style',
|
'style' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Style',
|
||||||
'workbook' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Workbook',
|
'workbook' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Workbook',
|
||||||
'worksheet' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Worksheet',
|
'worksheet' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Worksheet',
|
||||||
'drawing' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Drawing',
|
'drawing' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Drawing',
|
||||||
'comments' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Comments',
|
'comments' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Comments',
|
||||||
'chart' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\Chart',
|
'chart' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\Chart',
|
||||||
'relsvba' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\RelsVBA',
|
'relsvba' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\RelsVBA',
|
||||||
'relsribbonobjects' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Excel2007\\RelsRibbon',
|
'relsribbonobjects' => '\\PhpOffice\\PhpSpreadsheet\\Writer\\Xlsx\\RelsRibbon',
|
||||||
];
|
];
|
||||||
|
|
||||||
// Initialise writer parts
|
// Initialise writer parts
|
||||||
|
@ -152,7 +152,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
* Get writer part
|
* Get writer part
|
||||||
*
|
*
|
||||||
* @param string $pPartName Writer part name
|
* @param string $pPartName Writer part name
|
||||||
* @return \PhpOffice\PhpSpreadsheet\Writer\Excel2007\WriterPart
|
* @return \PhpOffice\PhpSpreadsheet\Writer\Xlsx\WriterPart
|
||||||
*/
|
*/
|
||||||
public function getWriterPart($pPartName = '')
|
public function getWriterPart($pPartName = '')
|
||||||
{
|
{
|
||||||
|
@ -416,7 +416,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
*
|
*
|
||||||
* @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object
|
* @param \PhpOffice\PhpSpreadsheet\Spreadsheet $spreadsheet PhpSpreadsheet object
|
||||||
* @throws Exception
|
* @throws Exception
|
||||||
* @return Excel2007
|
* @return Xlsx
|
||||||
*/
|
*/
|
||||||
public function setSpreadsheet(Spreadsheet $spreadsheet = null)
|
public function setSpreadsheet(Spreadsheet $spreadsheet = null)
|
||||||
{
|
{
|
||||||
|
@ -519,7 +519,7 @@ class Excel2007 extends BaseWriter implements IWriter
|
||||||
* Set Office2003 compatibility
|
* Set Office2003 compatibility
|
||||||
*
|
*
|
||||||
* @param bool $pValue Office2003 compatibility?
|
* @param bool $pValue Office2003 compatibility?
|
||||||
* @return Excel2007
|
* @return Xlsx
|
||||||
*/
|
*/
|
||||||
public function setOffice2003Compatibility($pValue = false)
|
public function setOffice2003Compatibility($pValue = false)
|
||||||
{
|
{
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\Axis;
|
use PhpOffice\PhpSpreadsheet\Chart\Axis;
|
||||||
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
use PhpOffice\PhpSpreadsheet\Chart\DataSeries;
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
use PhpOffice\PhpSpreadsheet\Chart;
|
use PhpOffice\PhpSpreadsheet\Chart;
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
||||||
|
@ -269,7 +269,7 @@ class Style extends WriterPart
|
||||||
{
|
{
|
||||||
// font
|
// font
|
||||||
$objWriter->startElement('font');
|
$objWriter->startElement('font');
|
||||||
// Weird! The order of these elements actually makes a difference when opening Excel2007
|
// Weird! The order of these elements actually makes a difference when opening Xlsx
|
||||||
// files in Excel2003 with the compatibility pack. It's not documented behaviour,
|
// files in Excel2003 with the compatibility pack. It's not documented behaviour,
|
||||||
// and makes for a real WTF!
|
// and makes for a real WTF!
|
||||||
|
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PhpSpreadsheet
|
* PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
* Copyright (c) 2006 - 2016 PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* PhpSpreadsheet
|
* PhpSpreadsheet
|
|
@ -1,6 +1,6 @@
|
||||||
<?php
|
<?php
|
||||||
|
|
||||||
namespace PhpOffice\PhpSpreadsheet\Writer\Excel2007;
|
namespace PhpOffice\PhpSpreadsheet\Writer\Xlsx;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
* Copyright (c) 2006 - 2015 PhpSpreadsheet
|
|
@ -21,7 +21,7 @@ class SampleTest extends \PHPUnit_Framework_TestCase
|
||||||
public function providerSample()
|
public function providerSample()
|
||||||
{
|
{
|
||||||
$skipped = [
|
$skipped = [
|
||||||
'07 Reader PCLZip', // Excel2007 cannot load file, leading to OpenOffice trying to and crashing. This is a bug that should be fixed
|
'07 Reader PCLZip', // Xlsx cannot load file, leading to OpenOffice trying to and crashing. This is a bug that should be fixed
|
||||||
'20 Read OOCalc with PCLZip', // Crash: Call to undefined method \PhpOffice\PhpSpreadsheet\Shared\ZipArchive::statName()
|
'20 Read OOCalc with PCLZip', // Crash: Call to undefined method \PhpOffice\PhpSpreadsheet\Shared\ZipArchive::statName()
|
||||||
'21 Pdf', // for now we don't have 3rdparty libs to tests PDF, but it should be added
|
'21 Pdf', // for now we don't have 3rdparty libs to tests PDF, but it should be added
|
||||||
];
|
];
|
||||||
|
|
Loading…
Reference in New Issue