Commit Graph

589 Commits

Author SHA1 Message Date
Nathanael d. Noblet 22bf54ca11 Allow Html Reader to write into existing spreadsheet
Sometimes you may want to read html into multiple worksheets within one
spreadsheet. Allowing the passing of a spreadsheet in makes this possible.
2019-11-17 21:17:56 +01:00
Paul Blacknell 788f79c1bb
Validate XIRR inputs and return correct error values
Fix: Return #NUM! if values and dates contain a different number of values
Fix: Return #NUM! if there is not at least one positive cash flow and one negative cash flow
Fix: Return #NUM! if any number in dates precedes the starting date
Fix: Return #NUM! if a result that works cannot be found after max iteration tries
Fix: Correct DocBlocks for XIRR & XNPV
Add: Validate XIRR with unit tests

Closes #1177
2019-11-17 21:17:12 +01:00
Dennis Holst 3fc2fa47de Check for existing xf index in mapping array before accessing it 2019-11-17 21:09:28 +01:00
Adrien Crivelli b636c56d7f
Code style 2019-11-17 21:03:47 +01:00
Jorge Casas 156ab360fe
Fixed Functions->ifCondition for allowing <> and empty condition
In cells with formulas containing conditions like `=IFSUM(A1:A3;"";B1:B3)`
to sum cells from range A1:A3 with empty value in range B1:B3, the function
`Functions::ifCondition()` create in this case the code `=""""` instead of
`=""`, so it didn't work.

Closes #1206
2019-11-17 21:03:11 +01:00
Jerome3 b20f5c1d11
Fix ODS Reader when no DC namespace are defined
ODS files without spreadsheet properties were triggering a fatal error

Fixes #1047
Fixes #1176
Closes #1182
2019-11-17 20:57:53 +01:00
Fräntz Miccoli 445cc18e39
Fix IF implementation to comply with Excel behavior
Closes #1165
2019-11-17 18:26:33 +01:00
Adrien Crivelli 5ec0e333dd
Fix code style 2019-11-17 17:44:02 +01:00
Diego Souza 157b6e75e4
useless parentheses 2019-11-17 17:40:20 +01:00
Diego Souza fac1d6de14
unnecessary string concatenation 2019-11-17 17:40:09 +01:00
Diego Souza ba735e21d6
combined assignment operator 2019-11-17 17:39:59 +01:00
Diego Souza d2cb2a0d1a
fixes UselessVariable and UnusedVariable from slevomat/coding-standard 2019-11-17 17:39:42 +01:00
Fräntz Miccoli 75dfcb5a36
Fix branch pruning resolution of non boolean conditions
Closes #1167
2019-11-10 22:59:09 +01:00
Adrien Crivelli 5441b2fa73
Keep big integer as integer instead of lossely casting to float
Closes #874
Fixes #1135
2019-11-10 22:51:53 +01:00
Adrien Crivelli d7d67ff39b
More explicit column index as string
Fixes #951
2019-11-10 20:58:20 +01:00
Suraxius 13eaeb39cf Fixes issue #948 (#1228)
* Fixes issue #948 by including a setUseEmbeddedCSS(false) method. Doesn't change current behaviour if not set

* Removes a empty line in src/PhpSpreadsheet/Writer/Html.php that fails a test
2019-11-01 00:52:20 +01:00
Mark Baker 617ea476c0
Complex number mask for integers containing a single dot (#1227) 2019-10-30 22:54:06 +01:00
Mark Baker 1b4098da8e
Minor scrutinizer fixes (#1226)
* Minor scrutinizer fixes

* Remove spurious debug output
2019-10-30 20:30:52 +01:00
Mark Baker 429a34cb14
Fix row/column range references against a different worksheet (#1224) 2019-10-29 23:35:23 +01:00
Jens Hassler 55209424b2 support "showZeros" setting in Excel advanced worksheet options (#1199)
* support "showZeros" setting in Excel advanced worksheet options

* add changelog entry

* change isShowZeros to getShowZeros
2019-10-28 21:52:30 +01:00
Mark Baker 43b760501a
Text data locale for fixedformat (#1220)
* Apply Locale settings to result of FIXEDFORMAT method call
2019-10-28 20:37:12 +01:00
David Arenas 89066d2568 Bugfix/remove column out of range (#1197)
* Call garbage collector after removing a column

Otherwise callers of getHighestColumn get stale values

* Update changelog

* Fix remove a column out of range removes the last column

Given:
+---+---+
| A | B |
+---+---+
Attempting to remove 'D', should not alter the worksheet

* Avoid side effects when trying to remove more columns than exists
2019-10-28 18:52:06 +01:00
David Arenas b82afe37dc Bugfix/invalid cached highest column after column removed (#1195)
* Call garbage collector after removing a column

Otherwise callers of getHighestColumn get stale values

* Update changelog
2019-10-28 18:42:56 +01:00
Boris Momčilović 9d6736d303 Writer: Xlsx: Worksheet: handle PHP 7.4 deprecation notice 2019-09-20 16:22:08 -07:00
MarkBaker f7d2ebac40 Minor fix to operator check 2019-09-20 16:22:08 -07:00
MarkBaker a691516664 Improvements to default value binder 2019-09-20 16:22:08 -07:00
MarkBaker b894b98a2c Test fixes for PHP 7.4 stricter behaviour 2019-09-20 16:22:08 -07:00
Adrien Crivelli ee5134a954
Merge branch 'master' into Further-Test-Refactoring 2019-09-20 16:04:36 -07:00
Andrey Dovbyshko ed25365531
Fix Writer\Html did not hide columns
Closes #985
2019-08-17 13:26:28 -07:00
yunjusu bbbfdb86a0
Fix `getCalculatedValue()` error with more than two INDIRECT
Closes #1115
2019-08-17 12:59:30 -07:00
Nathanael Noblet 95c8bb9918
Allow HTML Reader to load from string
We often want to export a table as an excel sheet. The system renders the
html and it seems like a waste of time to write it to the file system to
use the reader. This allows us to render the html and then just pass it to
a reader

Closes #1136
2019-08-17 12:54:22 -07:00
Adrien Crivelli 34675bdf5d
Remove dead code 2019-08-12 10:04:40 -07:00
Rolands Usāns 9df68f12e2 MATCH function fix
- fix boolean search
- add support for excel expressions `*?~`

Fixes #1116
Closes #1122
2019-08-11 20:11:36 -07:00
Adrien Crivelli 2166458de3
Duplicated call of strtoupper 2019-08-11 19:41:10 -07:00
Adrien Crivelli 7cca8d2bae Consistent format name and value 2019-08-11 19:39:49 -07:00
rumbleh 1e1118d9e0 Update NumberFormat.php
Fix FORMAT_DATE_DDMMYYYY from 'dd/mm/yy' to 'dd/mm/yyyy'
2019-08-11 19:39:49 -07:00
Alex Pravdin 5fe0a796c7
Fix incorrect cache clearance on row deletion
Fixes #868
Closes #871
2019-08-11 18:36:07 -07:00
Fräntz Miccoli 0b387e767e
Branch pruning around IF function calls to avoid resolution of every branches
Calculation engine was resolving every function by first resolving its arguments
including IFs, this was causing significant over evaluation when IFs were used
as it meant for every case to be evaluated.

Introduce elements to identify ifs and enable better branch resolution
(pruning). We tag parsed tokens to associate a branch identifier to them.

Closes #844
2019-08-11 18:23:47 -07:00
Mahmoud Abdo 785705b712
Best effort to support invalid colspan values in HTML reader
Closes #878
2019-07-27 23:31:23 -07:00
MarkBaker f14e5ea837 More refactoring Excel of Calculation Function Unit Tests 2019-07-27 16:35:27 +02:00
MarkBaker 905a697639 More work on refactoring Excel Calculation Function Unit Tests 2019-07-27 16:02:58 +02:00
Mark Baker 1c6f0b8a9d
Improved tests (#1110)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* New statistical tests

* Sniffs

* Additional statistical function unit tests

* Additional statistical function unit tests

* Fix case-sensitivity

* Fix HARMEAN code logic

* Unit tests refactored into individual files for all logical functions
Implemented IFNA()

* Fix silly typo

* NOT needs ...args to allow for test when no argument passed

* Codestyle

* Use instance asserts
2019-07-26 22:21:17 +02:00
Adrien Crivelli 7faee3d6cc
Take advantage of PHP 7.1 syntax 2019-07-24 23:43:28 -07:00
Adrien Crivelli 454d942c13
Drop PHP 5.6 and 7.0
This is according to our formal, published, policy to only support
eol PHP after 6 months.

See https://phpspreadsheet.readthedocs.io/en/latest/#php-version-support
2019-07-24 23:12:45 -07:00
JeongHean Kim dbc8777c43 Fix failed stat when using setEmbedImagesin HTML writer
Fixes #1084 
Closes #1085
2019-07-24 23:00:23 -07:00
Dominik Businger 98a1f0a8cf
Fix for worksheet lookup for worksheets with spaces in the title
Sheet titles containing " " or "!" will be quoted in formulas. This commit
fixes the lookup of sheets with this kind of title by trimming the quotes
during the lookup.

Without this any defined range referencing a sheet with " " or "!" in the title
name will be lost when reading the workbook from file.

Fixes #928
Closes 930
2019-07-24 22:15:35 -07:00
Mark Baker 9ad6de620e
Refactoring of date time tests (#1101)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* Separate out date/time tests into individual tests

* Need to update the version of phpunit at some point to deal with the new assertions and deprecated assertions

* Appease the CS Gods

* More refactoring of Date/Time tests

* Replace self assertions with instance assertions (looking forward to upgrading phpunit)

* Finish refactoring of date/time tests as individual tests

* Test for DateTimeInterface rather than for DateTime

* A few strict comparisons

* Fix to test names
2019-07-21 20:55:41 +02:00
Mark Baker ba2b74c222
Statistics functions extended tests (#1099)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* Further statistical tests

* Additional BINOMDIST tests
Extract boolean and string checking for Average and Count functions into separate methods

* Appease the great god PHPCS

* Yet more appeasement of the great god PHPCS

* Beginning to get really cheesed off with PHPCS, pulling me up over full stops in comments... I want to see this completed before going to bed; but it's nearly half past one in the morning, and phpcs has been pulling me up over trivialities for the past f***ing hour

* And a spurious line

* Further work on statistical tests
2019-07-21 13:07:18 +02:00
Mark Baker 554684720d
Statistical issues (#1098)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* Adjusted logic for COUNT() function to handle differences in EXCEL, GNUMERIC and OPENOFFICE modes for cells and for literal values

* Fix case-sensitivity in filenames

* Appeasing Codesniffer

* Resolve COUNTA() differences between cell values and literals

* Style fixes

* Start refactoring statistical function tests into individual tests rather than having a single, giant test for all statistical functions.... first step toward doing this for all tests

* More refactoring into separate tests
If all functions have their own individual test files, it should be a lot easier to identify which functions aren't covered by tests yet

* Missing last lines in files
2019-07-20 18:40:05 +02:00
Mark Baker 6d739f1fe6
Additional statistical work (#1088)
* Merge branch 'master' of C:\Projects\PHPOffice\PHPSpreadsheet\develop with conflicts.

* More statistical tests

* Further statistical tests

* Unit tests for some of the trend functions

* resolve scrutiniser objections

* Fix order of @return types :-(
2019-07-16 20:35:48 +02:00