Commit Graph

178 Commits

Author SHA1 Message Date
Mark Baker 9b44cf3418
Add further new Functions introduced in MS Excel 2013 and 2016 (#608)
- Fix ISFORMULA() function to work with a cell reference to another worksheet
 - Added calculation engine support for the new functions that were added in MS Excel 2013 and MS Excel 2016
   - Text Functions
     - CONCAT()     Synonym for CONCATENATE()
     - NUMBERVALUE()  Converts text to a number, in a locale-independent way
     - UNICHAR()    Synonym for CHAR() in PHPSpreadsheet, which has always used UTF-8 internally
     - UNIORD()     Synonym for ORD() in PHPSpreadsheet, which has always used UTF-8 internally
     - TEXTJOIN()   Joins together two or more text strings, separated by a delimiter
   - Logical Functions
     - XOR()        Returns a logical Exclusive Or of all arguments
   - Date/Time Functions
     - ISOWEEKNUM()  Returns the ISO 8601 week number of the year for a given date
   - Lookup and Reference Functions
     - FORMULATEXT()  Returns a formula as a string
   - Engineering Functions
     - ERF.PRECISE()   Returns the error function integrated between 0 and a supplied limit
     - ERFC.PRECISE()  Synonym for ERFC
   - Math and Trig Functions
     - SEC()          Returns the secant of an angle
     - SECH()         Returns the hyperbolic secant of an angle
     - CSC()          Returns the cosecant of an angle
     - CSCH()         Returns the hyperbolic cosecant of an angle
     - COT()          Returns the cotangent of an angle
     - COTH()         Returns the hyperbolic cotangent of an angle
     - ACOT()         Returns the cotangent of an angle
     - ACOTH()        Returns the hyperbolic cotangent of an angle
  - Financial Functions
    - PDURATION()    Calculates the number of periods required for an investment to reach a specified value
    - RRI()          Calculates the interest rate required for an investment to grow to a specified future value
2018-07-22 19:17:04 +01:00
Adrien Crivelli 3028c60656
Remove unnecessary docs 2018-07-15 13:23:46 +09:00
Adrien Crivelli 863fb86925
Remove file header 2018-07-15 13:23:23 +09:00
yuzhakov 17d4a54666
Read and write hyperlink for drawing image
Fixes #490
2018-07-15 13:00:30 +09:00
Einar Lielmanis b05d07a365 Chained operations on cell ranges involving borders are now possible
Fixes #428
Fixes #578
2018-07-15 12:19:54 +09:00
Rolands Usāns eb31899225 Function EXACT(arg1, arg2) support (#595) 2018-07-15 11:56:25 +09:00
Adrien Crivelli 9fdcaabe3c
Could not open CSV file containing HTML fragment
We now always trust the file extension to avoid false positive of mime
detection for most simple cases. But we still try to guess the mime type
if the file extension does not match or is missing.

Fixes #564
2018-06-25 11:12:27 +09:00
Bill Blume edb68ce05c
Support workbook view attributes for Xlsx format
Editing a Xlsx document using PhpSpreadsheet should preserve the workbook
view attributes of that document. For example, if the worksheet tabs are
hidden in the original document, they should remain hidden after updating.

Fixes #523
Fixes #525
2018-06-24 20:15:38 +09:00
Derek Bonner 7a4cbd4fd5 Cell formats with escaped spaces were causing incorrect date formatting
Fix issue where escaped spaces in cell format would cause incorrect
date format leading to incorrect time conversions

Fixes #557
Closes #558
2018-06-24 19:35:45 +09:00
Adrien Crivelli 371c800e3f
Ranges across Z and AA columns incorrectly threw an exception
Fixes #545
2018-06-11 22:54:11 +09:00
Bill Blume 4c09d4f668
Properly set selected cells for frozen panes
Properly set the selected cells for worksheets with frozen panes when
writing Xlsx documents. Beforehand, the saved Xlsx documents were
generating corruption warnings when opened in Excel.

Fixes #532
Closes #535
2018-06-10 14:56:53 +09:00
Bill Blume e3fb160f5f
Fixed parsing of conditionals in COUNTIF functions
Conditional operators in the selection parameter of COUNTIF
functions were not being parsed properly, causing evaluations
of formulae with such functions to sometimes fail.

Fixes #526
Closes #528
2018-06-10 14:25:33 +09:00
Robin D'Arcy ed2185417e
Throw exception for invalid range to prevent infinite loop
Fixes #519
Closes #521
2018-06-10 13:34:10 +09:00
Dominik b509b672e0
Xlsx reader do not read rows and columns filtered out in readFilter at all
Set rows and columns dimensions for only cells rows and columns
allowed by readfilter

Fixes #370
Closes #421
2018-05-26 13:30:21 +09:00
Dominik 7e9f43bf5b
Fix Xlsx loaded an extra empty comment for each real comment
Fixes #375
Closes #420
2018-05-26 11:19:12 +09:00
Robin D'Arcy c723833d6f Allow CSV escape character to be set
Fixes #492
Closes #510
2018-05-23 10:31:41 +09:00
Adrien Crivelli 148909300c
`Helper\Html` support UTF-8 HTML input
Assume UTF-8 encoding. Not assuming UTF-8 would mangle text such as "русский"

Fixes #444
2018-05-20 19:52:53 +09:00
Adrien Crivelli eda1c8a4d6
Fix spacing according to Scrutinizer 2018-05-12 22:02:46 +09:00
Maxim Bulygin 83c759e951
Support to read and write unsupported data for XLSX
This will let users read a file that contains data that are not properly
supported and write them back to a new file untouched.

- load workbookProtection attributes
- save loaded pageSetup[r:id]
- save loaded sheet's AlternateContent
- save loaded unparsed VmlDrawings
- save loaded drawing files `rId`
- save loaded draw's AlternateContent
- save loaded control properties
- save loaded printer settings
- save loaded unparsed override content types (for ctrlProp, ...)

Closes #435
2018-05-12 11:47:46 +09:00
Adrien Crivelli 064076ac6d
Fix unit tests for PHP 5.6 2018-05-07 11:53:55 +09:00
MarkBaker bbe11eed37 Full unit tests for SUBTOTAL function 2018-05-06 23:43:02 +01:00
MarkBaker 3298667153 Mark SUBTOTAL test as skipped for the moment 2018-04-21 21:28:41 +01:00
MarkBaker f08eeaa2ed Code works, but the tests don't yet 2018-04-21 20:34:25 +01:00
MarkBaker 36afa01d33 SUBTOTAL within a SUBTOAL range should be ignored 2018-04-21 01:33:26 +01:00
MarkBaker 04b4e74ec7 Basic unit testing for 100 series actions for SUBTOTAL() with hidden rows/columns 2018-04-20 07:24:11 +01:00
MarkBaker 1ece540254 Basic unit test for SUBTOTAL() function 2018-04-19 22:44:23 +01:00
Tony Brix bdc95b14bf
Select correct cell when calling freezePane
Fixes a bug when calling `$sheet->freezePane('B2')` without a second argument.
The selected cell will now be `B2` instead of the incorrect `B3`.

Fixes #389
Closes #393
2018-03-03 16:48:30 +01:00
Josh Grant a089a87671
Avoid losing calculated value type
Closes #394
2018-03-03 11:51:06 +01:00
Josh Grant 148bee1991
Support `_xlfn.` prefix and add `ISFORMULA`, `MODE.SNGL`, `STDEV.S`, `STDEV.P`
This change adds support for newer functions that are prefixed
by _xlfn. (#356). The calculation engine has been updated to
recognise these as functions, and drop the _xlfn. part.

It also add a couple of the new functions such as STDEV.S/P,
MODE.SNGL, ISFORMULA.

Fixes #356
Closes #390
2018-02-26 09:35:53 +01:00
Adrien Crivelli 1adc3a6688
Read printing area correctly when skipping some sheets
Fixes #371
2018-02-25 19:40:11 +01:00
Adrien Crivelli e31878ceb1
Check for MIME type to know if CSV reader can read a file
CSV reader used to accept any file without any kind of check. That made
users incorrectly believe that things were ok, even though there is no
way for CSV reader to read anything else that plain text files.

Fixes #167
2018-02-05 21:33:23 +09:00
Adrien Crivelli d2f55ffa07
Support PHP 7.2 2018-01-28 16:23:38 +09:00
Adrien Crivelli c96e2dae02
Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
MaxTingle 49775bd972
Fix cell ranges causing coordinate merge error
Fixes #319
Closes #328
2018-01-22 12:26:37 +09:00
Michael Bollman 4e0344c3af
Use line width for data series when rendering Xlsx
Closes #329
2018-01-22 11:50:53 +09:00
Adrien Crivelli 481fc4a7c6
Support XML file without styles
Closes #331
Closes https://github.com/PHPOffice/PHPExcel/pull/559
Fixes https://github.com/PHPOffice/PHPExcel/issues/558
2018-01-14 17:08:50 +09:00
Adrien Crivelli bf2dbbaf10
COLUMNS and ROWS functions crashed in some cases
Fixes #336
Fixes https://github.com/PHPOffice/PHPExcel/issues/1383
2018-01-13 18:01:50 +09:00
Adrien Crivelli 25bc54f9eb
Freeze Panes takes wrong coordinates for XLSX
Fixes #322
2018-01-09 00:42:30 +09:00
Steffen Breiler 653adf8e10
Adding option to stop at a conditional styling, if it matches
This would be used like `$conditonal->setStopIfTrue()` and is only supported
for XLSX format for now.

Closes #292
2018-01-07 22:45:51 +09:00
Christoph "criztovyl" Schulz cdbf3347cb
Support for cell comments in HTML writer and reader
The behavior is similar to what is done in LibreOffice. That means if there is a
comment it will be shown with a small indicator and the actual comment will be
revealed when mouse hover over the indicator.

Fixes #308
Closes #310
2018-01-07 21:51:48 +09:00
Adrien Crivelli 4f1fae5298
Test classes must ends with `Test` 2018-01-02 00:53:28 +09:00
Adrien Crivelli 36441da330
Fix unit tests for 2018
Closes #311
2018-01-02 00:39:38 +09:00
Adrien Crivelli 4dd486fb94
Clean up very obsolete links 2017-12-30 19:07:22 +09:00
Adrien Crivelli 139d85d874
Better auto-detection of CSV separators
Closes #305
2017-12-28 12:25:37 +09:00
Adrien Crivelli fb5f8d4763
Support DateTimeImmutable as cell value 2017-12-23 21:50:07 +09:00
Adrien Crivelli 32a55a3f13
Introduce identical functional tests across several formats 2017-12-17 16:35:20 +09:00
Adrien Cohen 11b055b29f
Able to set the `topLeftCell` in freeze panes
Fixes #260
Closes #261
2017-12-17 13:32:16 +09:00
Adrien Crivelli eb58563b4b
Written DataValidation was corrupted
Fixes #290
2017-12-16 17:15:13 +09:00
Adrien Crivelli 08e860b993
Uncomment test cases 2017-12-11 12:22:49 +09:00
Adrien Crivelli 96f3f666d6
Support to write merged cells in ODS format
Fixes #287
2017-12-11 12:17:40 +09:00