Commit Graph

216 Commits

Author SHA1 Message Date
MarkBaker ecc18d2220 Binary-value options for Reader using flag settings 2022-10-03 11:33:29 +02:00
MarkBaker 541bf0f876 Merge branch 'master' into 2.0-Development
# Conflicts:
#	docs/topics/calculation-engine.md
#	phpstan-baseline.neon
#	src/PhpSpreadsheet/Reader/Xlsx.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ConvertUoMTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfCTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfPreciseTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ErfTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/Engineering/ParseComplexTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/Financial/IrrTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/AddressTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/ColumnsTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndexTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/IndirectTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/RowsTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/FactTest.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/TextData/NumberValueTest.php
2022-09-25 16:57:54 +02:00
oleibman a2b2984104 Document Charset Restriction for Html/Xml Reader (#3068)
Fix #1681, although probably not to the originator's satisfaction. Html and Xml readers will handle documents only with a charset of UTF-8. This PR documents that restriction. No change to source code; see the original issue for explanation.
2022-09-19 06:49:01 -07:00
MarkBaker 8ecf69a5c4 Handle additional merge options like those provide in OpenOffice or LibreOffice to hide cell values in a merge range rather than empty them, or to merge the values as well as the cells
This includes reading hidden values in merge ranges, so that Unmerging can restore their visibility
2022-09-15 21:07:31 +02:00
MarkBaker 026f699a65 Minor documentation updates 2022-08-29 17:14:03 +02:00
Alexis Lefebvre d0781c3fd2 Explain that UoM = Unit of Measure (#3014) 2022-08-24 17:47:22 -07:00
MarkBaker fe4808b3d5 Merge branch 'master' into 2.0-Development
# Conflicts:
#	composer.lock
#	tests/PhpSpreadsheetTests/Calculation/Functions/LookupRef/VLookupTest.php
2022-08-03 14:03:43 +02:00
MarkBaker 06d2682c5b Documentation markdown fix 2022-08-03 12:43:38 +02:00
MarkBaker a8fc5bc954 Merge branch '2.0-Development' into CalculationEngine-Array-Formulae-Initial-Work
# Conflicts:
#	phpstan-baseline.neon
#	tests/PhpSpreadsheetTests/Worksheet/WorksheetTest.php
2022-06-18 13:48:44 +02:00
MarkBaker 05a125213b Merge branch 'master' into 2.0-Development
# Conflicts:
#	phpstan-baseline.neon
2022-06-18 13:00:25 +02:00
MarkBaker f51f4bc0ea Update change log and documentation 2022-06-15 12:59:38 +02:00
Tomas Votruba 0aedef4902 Update excel migration with sets() method (#2861) 2022-05-31 07:19:43 -07:00
MarkBaker b1ca6eee66 Merge branch '2.0-Development' into CalculationEngine-Array-Formulae-Initial-Work
# Conflicts:
#	phpstan-baseline.neon
2022-05-28 11:33:42 +02:00
MarkBaker 89b70a0860 Merge branch 'master' into 2.0-Development 2022-05-28 11:32:10 +02:00
MarkBaker 3302701ae7 Declare a few return datatypes 2022-05-26 15:20:41 +02:00
MarkBaker bb7e083745 Add Hidden Worksheet unit tests for other Readers 2022-05-24 14:40:45 +02:00
oleibman 567b9601b0 Allow Csv Reader to Store Null String in Spreadsheet (#2842)
Fix #2840 (and also #2839 but that's Q&A, not an issue). Csv Reader does not populate cells which contain null string. This PR provides an option for the reader to store null strings as it does with any other string.
2022-05-21 07:21:14 -07:00
MarkBaker 33d3442777 Merge branch '2.0-Development' into CalculationEngine-Array-Formulae-Initial-Work
# Conflicts:
#	phpstan-baseline.neon
#	src/PhpSpreadsheet/Calculation/Calculation.php
#	src/PhpSpreadsheet/Calculation/Functions.php
#	src/PhpSpreadsheet/Calculation/MathTrig.php
2022-05-13 08:53:29 +02:00
MarkBaker f5b4308f22 Merge branch 'master' into CalculationEngine-Array-Formulae-Initial-Work 2022-05-11 21:01:34 +02:00
MarkBaker 297817ff0f Merge branch 'master' into 2.0-Development 2022-05-10 16:01:58 +02:00
oleibman 35530502d2 Allow Csv Reader to Treat String as Contents of File (#2792)
See #1285, which went stale and was closed, but recently received some positive feeback. It seems easy to implement, and the only other plaintext file format, Html, allows loading from a string. Those two reasons combined suggest that we should do it.
2022-05-07 08:24:53 -07:00
MarkBaker d613de1da5 Merge branch 'master' into CalculationEngine-Array-Formulae-Initial-Work
# Conflicts:
#	docs/references/function-list-by-category.md
#	docs/references/function-list-by-name.md
#	phpstan-baseline.neon
#	src/PhpSpreadsheet/Worksheet/Worksheet.php
2022-04-30 13:27:40 +02:00
MarkBaker 53a6ab9c8b Merge branch 'master' into 2.0-Development 2022-04-27 12:48:57 +02:00
MarkBaker 6b1be8c09f Add "Not yet Implemented" stubs for 14 new Excel Functions
- TEXTBEFORE – Returns text that’s before delimiting characters
- TEXTAFTER – Returns text that’s after delimiting character
- TEXTSPLIT – Splits text into rows or columns using delimiters
- VSTACK – Stacks arrays vertically
- HSTACK – Stacks arrays horizontally
- TOROW – Returns the array as one row
- TOCOL – Returns the array as one column
- WRAPROWS – Wraps a row array into a 2D array
- WRAPCOLS – Wraps a column array into a 2D array
- TAKE – Returns rows or columns from array start or end
- DROP – Drops rows or columns from array start or end
- CHOOSEROWS – Returns the specified rows from an array
- CHOOSECOLS – Returns the specified columns from an array
- EXPAND – Expands an array to the specified dimensions
2022-04-27 12:25:18 +02:00
MarkBaker 0998e72a2e Eliminate underscore prefix in method names... no longer needed as an indicator that a method should be internal only 2022-04-26 22:40:10 +02:00
MarkBaker 9275d0c59e Improved documentation for setting row height/column width 2022-04-19 16:42:34 +02:00
MarkBaker 4a65011a2f Allow Reader format identification to use a subset of possible Readers 2022-04-19 14:24:53 +02:00
MarkBaker 925c730c3b Some more unit tests for array functions and spillage; and updates to documentation 2022-03-14 15:57:12 +01:00
MarkBaker 2c95f3a9f8 Merge branch 'master' into CalculationEngine-Array-Formulae-Initial-Work 2022-03-04 14:59:27 +01:00
Mark Baker dd981a3d77 Merge branch 'master' into CSV-Reader-Dataype-casting-improvements 2022-03-04 14:25:37 +01:00
Paul Weidner 23631cb9e5 Correct fill color example in conditional formatting docs. (#2646) 2022-03-04 01:41:21 -08:00
MarkBaker aad91f1d25 Merge branch 'master' into CSV-Reader-Dataype-casting-improvements
# Conflicts:
#	src/PhpSpreadsheet/Reader/Csv.php
2022-03-02 12:43:19 +01:00
MarkBaker 45ca934a53 Update Change Log and Documentation 2022-03-02 12:33:20 +01:00
oleibman f575d2b8b2 Add Ability to Suppress Mac Line Ending Check for CSV Reader (#2623)
With the deprecation of `auto_detect_line_endings` in Php8.1, there have been some tickets (issue #2609 and PR #2438). Although the deprecation message is suppressed, users with a homegrown error handler may still see it. I am not very concerned about that symptom, but I imagine that there will be more similar tickets in future. This PR adds a new property/method to Reader/CSV to allow the user to avoid the deprecated code, at the negligible cost of being unable to read a CSV with Mac line endings even on a Php version that could support it.
2022-03-01 02:01:37 -08:00
MarkBaker 5579712688 Make CSV Reader boolean casting (e.g. string `"TRUE" to boolean TRUE) locale-aware. 2022-02-27 23:06:22 +01:00
MarkBaker 568921ca71 Start work linking cells in spillage areas to the cell containing the spilled formula 2022-02-23 17:28:40 +01:00
MarkBaker 05204667d9 Merge branch 'master' into CalculationEngine-Array-Formulae-Initial-Work
# Conflicts:
#	src/PhpSpreadsheet/Calculation/MathTrig.php
#	src/PhpSpreadsheet/Calculation/MathTrig/Absolute.php
#	tests/PhpSpreadsheetTests/Calculation/Functions/MathTrig/AbsTest.php
2022-02-09 15:29:57 +01:00
JRK d0c9ea340e Fix documentation, instantiation example (#2564) 2022-02-07 17:37:07 +01:00
MarkBaker c84e3344d9 Update documentation with details of array formula handling, and the Spill Operator 2022-02-04 10:18:16 +01:00
MarkBaker 7d84fafbb0 Updates to function lists 2022-02-04 10:18:15 +01:00
Mark Baker 3b81917760 Fix discrepancy between the way markdown tables are rendered in ReadTheDocs and in PHPStorm (#2520) 2022-01-22 21:00:22 +01:00
Mark Baker 4a04499bff Read conditional styling for cell (#2491)
* Allow single-cell checks on conditional styles, even when the style is configured for a range of cells
* Work on the CellMatcher logic to evaluate Conditionals for a cell based on its value, and identify which conditional styles should be applied
* Refactor style merging and cell matching for conditional formatting into separate classes; this should make it easier to test, and easier to extend for other CF expressions subsequently
* Added support for containsErrors and notContainsErrors
* Initial work on a wizard to help simplify created Conditional Formatting rules, to ensure that the correct expressions are set
* Further work on extending the Conditional Formatting rules to cover more of the options that are available in MS Excel
* Prevent phpcs-fixer from removing class @method annotations, used to identify the signature for magic methods used in Wizard classes
* Implement `fromConditional()`` method to allow the creation of a CF Wizard from an existing Conditional
* Ensure that xlsx Reader picks up the timePeriod attribute for DatesOccurring CF Rules
* Allow Duplicates/Uniques CF Rules to be recognised in the Xlsx Reader
* Basic Xlsx reading of CF Rules/Styles from <extLst><ext><ConditinalFormattings> element, and not just the <ConditinalFormatting> element of the worksheet

* Add some validation for operands passed to the CF Wizards
 - remove any leading ``=` from formulae, because they'll be embedded into other formulae
 - unwrap any string literals from quotes, because that's also handled internally

Handle cross-worksheet cell references in cellReferences and Formulae/Expressions

* re-baseline phpstan

* Update Change Log with details of the CF Improvements
2022-01-22 19:18:26 +01:00
leo-bsv a7f687fe5c Xlsx image background in comments #1547 (#2422)
* XLSX Image background in comments

* XLSX-Image-Background-In-Comments (#1547)

* Test fixes, convertion for comment sizes from px to pt, fix for setting image sizes from zip, set image type

* Merge remote-tracking branch 'origin/XLSX-Image-Background-In-Comments' into XLSX-Image-Background-In-Comments

* Tests to check reloaded document.

Co-authored-by: Burkov Sergey
2021-12-17 06:10:59 -08:00
oleibman 9c8eeef96d Xlsx Writer Unhides Explicitly Hidden Row in Filter Range - Minor Breaking Change (#2414)
Fix #1641. Excel allows explicit hiding of row after filter is applied, but PhpSpreadsheet automatically invokes showHideRows on all auto-filters, preventing users from doing the same. Change to invoke showHideRows only if it hasn't already been invoked, or if filter criteria have changed since it was last invoked. Autofilters read in from an existing spreadsheet are assumed to be already invoked.

This is potentially a breaking change, probably a minor one. The conditions to set up 1641 are probably uncommon, but users who meet those conditions and are happy with the current behavior will see a break. The new behavior is closer to how Excel itself behaves. A new method `reevaluateAutoFilters` is added to `Spreadsheet`; this can be used to restore the old behavior if desired. The new method is added to the documentation, along with a description of how the situation described in 1641 is handled in Excel and PhpSpreadsheet.

While examining Excel's behavior, it became evident that, although a filter is applied to an entire column, it is actually applied only to the rows that are populated when the filter is defined, as can be verified by examining the XML definition of the filter. When you re-apply the filter, rows that have been added since are considered. It would be useful to provide PhpSpreadsheet with a method to do the same. I have added, and documented, `setRangeToMaxRow` to `AutoFilter`.
2021-12-05 07:26:24 -08:00
oleibman 580c741c8e Improve PDF Support for Page Size and Orientation (#2410)
Fix #1691. PhpSpreadsheet allows the setting of different page size and orientation on each worksheet. It also allows the setting of page size and orientation on the PDF writer. It isn't clear which is supposed to prevail when the two are in conflict. In the cited issue, the user expects the PDF writer setting to prevail, and I tend to agree. Code is changed to do this, and handling things in this manner is now explicitly documented.

PhpSpreadsheet uses a default paper size of Letter, and a default orientation of Default (which Excel treats as Portrait). New static routines are added to change the default for sheets created subsequent to such calls. This could allow users to configure these defaults better for their environments. The new functions are added to the documentation.
2021-12-01 23:00:02 -08:00
Adrien Crivelli 46df15c2da Restore explicit list of changes to PHPExcel migration document
Fixes #1546
2021-11-23 23:57:41 +09:00
oleibman 2a12587f05 AutoFilter Improvements (#2393)
* AutoFilter Improvements

Fix issue #2378. The following changes are made:
- NotEqual tests must be part of a custom filter. Documentation has been changed to indicate that.
- Method setAndOr was replaced by setJoin some time ago. Documentation now reflects that change.
- Documentation to indicate that string filters are not case-sensitive, same as in Excel.
- Filters testing against numeric value now include a numeric test (not numeric for not equal, numeric for all others).
- String filter had previously treated everything as a test for "equal". It now handles "not equal" and the variants of "greater/less" with or without "equal".
- Documentation correctly stated that no more than 2 rules are allowed in a custom filter. Code did not enforce this restriction. It now does, throwing an exception if an attempt is made to add a third rule.
- Deleted a lot of comments in Rule.php to make it easier to see what is not yet implemented (between, begins with, etc.). I may take these on in future.
- Added a number of tests for the new functionality.

* Not Sure Why Phpstan Results Differ Local vs Github

Let's see if this change suffices.

* Phpstan Still

Not sure how to convince it. Let's try this.

* Phpstan Solved

Figured out the problem on my local machine. Expect this to work.
2021-11-16 07:46:07 -08:00
Adrien Crivelli 858e073063 Drop PHP 7.2
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
2021-11-01 12:01:54 +09:00
Adrien Crivelli 69f633420b Merge branch 'master' into PHP8-Sane-Property-Names 2021-10-31 15:25:01 +09:00
jomisacu 11f758e412 use single quotes to wrap sheet title
This changes is to clarify that the sheet title is used to reference the sheet and that the title must be single quoted.
2021-10-30 12:44:21 +09:00