Commit Graph

4118 Commits

Author SHA1 Message Date
MarkBaker ddb9891d05 Don't try to render every chart in CLI mode 2023-04-13 11:23:34 +02:00
MarkBaker 71898419ce Improve web-rendering of Chart Examples by displaying the rendered image 2023-04-12 11:26:05 +02:00
oleibman 86d2505925 Documentation Updates (#3517)
Fix #3471. Fix #3514. No code changes.
2023-04-10 08:45:14 -07:00
oleibman ffc6f307d3 Change Log (#3516)
* Change Log

Catch up some undocumented changes.

* Missed One

Add it now.
2023-04-08 23:28:48 -07:00
oleibman aab16147e4 Add Ability to Ignore Cell Errors in Excel (#3508)
* Add Ability to Ignore Cell Errors in Excel

Fix #1141, which had been closed as stale, but which I have reopened. Excel will show cells with certain "errors" with a green triangle in the upper left. The suggestion in the issue to use quotePrefix to suppress the numberStoredAsText error is ineffective. In Excel, the user can turn this indicator off for individual cells. Cells where this is turned off can be detected at read time, and PhpSpreadsheet will now process those. In addition, the user can explicitly set the ignored error as in Excel.
```php
$cell->setIgnoredErrorNumberStoredAsText(true);
```

There are a number of different errors that can be ignored in this fashion. This PR implements `numberStoredAsText` (which is likely to be by far the most useful one), `formula`, `twoDigitTextYear`, and `evalError`, all of which are demonstrated in the new test spreadsheet. There are several others for which I am not able to create good examples; I have not implemented those, but they can be easily added if needed (`calculatedColumn`, `emptyCellReference`, `formulaRange`, `listDataValidation`, and `unlockedFormula`).

* Scrutinizer

A new change, a new Scrutinizer false positive.

* Move Ignored Errors to Own Class

In response to comments from @MarkBaker, implement ignoredError as a new class. This simplifies Cell by requiring only 1 new method, rather than 8+. This requires a slightly more complicated syntax.
```php
$cell->getIgnoredErrors()->setNumberScoredAsText(true);
```

Mark had also suggested that there might be a pre-existing regexp for processing the cells/cellranges when reading the sqref attribute. Those in Calculation are too complicated (read "non-performant") for this piece of code; the one in Coordinates is slightly less complicated than Calculation, but still more complicated than the one I'm using, and doesn't handle ranges.
2023-04-08 21:58:07 -07:00
Mark Baker 5ef48e90ce Merge pull request #3512 from PHPOffice/Issue-3511_NumberFormat-colour-indexed-palette
Allow color palette index values in number format masks
2023-04-07 12:21:47 +02:00
Mark Baker 24725c8f74 Merge branch 'master' into Issue-3511_NumberFormat-colour-indexed-palette 2023-04-07 12:08:33 +02:00
Mark Baker e5ed8e932b Merge pull request #3509 from PHPOffice/Stricter-Identify-Spreadsheet-Files-Only
Validate that OLE file contains a workbook object (ie. isn't a doc or a ppt file)
2023-04-07 01:55:38 +02:00
Mark Baker 9e384a1094 Merge branch 'master' into Stricter-Identify-Spreadsheet-Files-Only 2023-04-07 01:37:56 +02:00
MarkBaker 44c74f8eca Update change log 2023-04-06 10:18:22 +02:00
Mark Baker 937d5f7450 Merge pull request #3510 from PHPOffice/Examples-Fixed-Header
Fix header for examples to make navigation easier
2023-04-06 03:42:15 +02:00
MarkBaker c5fb58fe68 Allow color palette index values in number format masks 2023-04-06 03:41:20 +02:00
Mark Baker 5c3d360fe6 Merge branch 'master' into Examples-Fixed-Header 2023-04-06 03:31:00 +02:00
Mark Baker c7cd388bf3 Merge pull request #3506 from PHPOffice/Samples-Table-Column-Formula-with-Total
New Autofilter example: column formula with totals
2023-04-06 03:30:31 +02:00
Mark Baker f6f7b47427 Merge branch 'master' into Samples-Table-Column-Formula-with-Total 2023-04-06 03:13:27 +02:00
oleibman e5697fbc4e Xlsx Reader Formula with quotePrefix (#3497)
Fix #3495. This seems to be a bug in Excel, one which it manages to cover up but PhpSpreadsheet is affected. User enters a formula preceded by an apostrophe into a cell. Excel turns on `quotePrefix` style and stores the data as a string rather than a formula. User now enters a formula not preceded by an apostrophe into the same cell. Excel stores it is a formula but does not turn `quotePrefix` off. When the spreadsheet is saved, the cell's style specifies `quotePrefix`, but the cell's content indicates it's a formula. Till now, PhpSpreadsheet sees that quotePrefix is set, and therefore treats the cell's contents as a string rather than a formula. This PR will change that behavior so that quotePrefix is automatically turned off when Xlsx Reader sees that the cell indicates that it is a formula.
2023-04-04 07:29:47 -07:00
MarkBaker 495a011d26 Fix header for examples to make navigation easier 2023-04-04 01:47:38 +02:00
MarkBaker ee1075dc09 Validate that OLE file contains a workbook object (ie. isn't a doc or a ppt file) 2023-04-04 00:14:15 +02:00
MarkBaker 0613cbd1bf New Autofilter example: column formula with totals 2023-04-03 04:55:04 +02:00
Mark Baker 5da2f6ec42 Merge pull request #3503 from PHPOffice/Examples-AutoFilter-Improvements
Examples auto filter improvements
2023-04-02 21:49:38 +02:00
Mark Baker 82e513162f Merge branch 'master' into Examples-AutoFilter-Improvements 2023-04-02 21:30:46 +02:00
Mark Baker 0e17cbb480 Merge pull request #3505 from PHPOffice/Issue-3504_Structured-Reference-Range-Cache
Resolve Issue #3504
2023-04-02 21:29:47 +02:00
MarkBaker 8e3f385224 Resolve Issue #3504
Cached result for a this row range with structured references
2023-04-02 20:22:51 +02:00
MarkBaker 44f3dbe82b Improved Table examples 2023-04-02 20:05:59 +02:00
MarkBaker 9cf41b5dd2 Improved AutoFilter examples 2023-04-02 20:05:43 +02:00
MarkBaker 3f418ceb9a Merge branch 'master' into Examples-AutoFilter-Improvements 2023-04-01 22:44:17 +02:00
Mark Baker 378d46b761 Merge pull request #3494 from PHPOffice/Worksheet-toArray_Ignore-Hidden-Rows-Columns-Option
Provide an Ignore/Return Hidden rows/columns option to the `toArray()` methods
2023-04-01 22:39:12 +02:00
Mark Baker 5ebb1c9943 Merge branch 'master' into Worksheet-toArray_Ignore-Hidden-Rows-Columns-Option 2023-04-01 22:22:23 +02:00
dependabot[bot] f4e897e3b9 Bump mitoteam/jpgraph from 10.2.5 to 10.2.6 (#3502)
Bumps [mitoteam/jpgraph](https://github.com/mitoteam/jpgraph) from 10.2.5 to 10.2.6.
- [Release notes](https://github.com/mitoteam/jpgraph/releases)
- [Commits](https://github.com/mitoteam/jpgraph/compare/10.2.5...10.2.6)

---
updated-dependencies:
- dependency-name: mitoteam/jpgraph
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-01 09:02:07 -07:00
dependabot[bot] efa462f76f Bump friendsofphp/php-cs-fixer from 3.14.4 to 3.15.1 (#3501)
Bumps [friendsofphp/php-cs-fixer](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer) from 3.14.4 to 3.15.1.
- [Release notes](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/releases)
- [Changelog](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/blob/master/CHANGELOG.md)
- [Commits](https://github.com/PHP-CS-Fixer/PHP-CS-Fixer/compare/v3.14.4...v3.15.1)

---
updated-dependencies:
- dependency-name: friendsofphp/php-cs-fixer
  dependency-type: direct:development
  update-type: version-update:semver-minor
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-01 08:56:09 -07:00
dependabot[bot] 74f455a373 Bump phpstan/phpstan-phpunit from 1.3.9 to 1.3.11 (#3500)
Bumps [phpstan/phpstan-phpunit](https://github.com/phpstan/phpstan-phpunit) from 1.3.9 to 1.3.11.
- [Release notes](https://github.com/phpstan/phpstan-phpunit/releases)
- [Commits](https://github.com/phpstan/phpstan-phpunit/compare/1.3.9...1.3.11)

---
updated-dependencies:
- dependency-name: phpstan/phpstan-phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-01 08:19:36 -07:00
dependabot[bot] 79ecc8bbae Bump phpstan/phpstan from 1.10.3 to 1.10.9 (#3499)
Bumps [phpstan/phpstan](https://github.com/phpstan/phpstan) from 1.10.3 to 1.10.9.
- [Release notes](https://github.com/phpstan/phpstan/releases)
- [Changelog](https://github.com/phpstan/phpstan/blob/1.10.x/CHANGELOG.md)
- [Commits](https://github.com/phpstan/phpstan/compare/1.10.3...1.10.9)

---
updated-dependencies:
- dependency-name: phpstan/phpstan
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-01 07:52:31 -07:00
dependabot[bot] 9ded32a72f Bump phpunit/phpunit from 9.6.4 to 9.6.6 (#3498)
Bumps [phpunit/phpunit](https://github.com/sebastianbergmann/phpunit) from 9.6.4 to 9.6.6.
- [Release notes](https://github.com/sebastianbergmann/phpunit/releases)
- [Changelog](https://github.com/sebastianbergmann/phpunit/blob/main/ChangeLog-9.6.md)
- [Commits](https://github.com/sebastianbergmann/phpunit/compare/9.6.4...9.6.6)

---
updated-dependencies:
- dependency-name: phpunit/phpunit
  dependency-type: direct:development
  update-type: version-update:semver-patch
...

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2023-04-01 07:42:11 -07:00
oleibman d6180ad113 Font Themes (#3486)
* Font Themes

It isn't a feature of Excel that I've made any use of, but PR #3476 added better Theme support for colors, and it is relatively easy to add Theme support for Fonts on top of that.

Excel assigns two theme fonts to its spreadsheets, one for Headings (major), and one for Body (minor). If the body theme is Calibri, when you choose a font for a cell in Excel, you can choose 'Calibri (Body)' from the Theme Fonts section at the top of the Font dropdown, or 'Calibri' from the 'All Fonts' section. If you choose the former, the cell will be automatically restyled if you change the Theme Fonts (via Page Layout, Themes, Fonts). The relationship to the theme fonts is recorded in the XML via a `scheme` tag (descending from `font`) whose `val` attribute can be either `major` or `minor`. Accordingly, this PR, in addition to defining the Theme Font properties, adds a `scheme` property, with getter and setter, to Style/Font.

The main benefit of this PR is that you can now load and save a spreadsheet preserving the connections to the Theme Fonts, without having to take any additional action.

A secondary benefit arises from the following difference. Empty cells in Excel will use the spreadsheet's default font name when they are filled in; but, in Google Sheets, they will use the Theme Minor Font name. By setting the `scheme` property in the default style, the resulting spreadsheet will behave the same in both Excel and Google.

I will note that Excel's font themes specify a Latin font, an East Asian font, a Complex Scripts font, and a set of font substitutions for various languages. PhpSpreadsheet will preserve all of these, and allow them to be changed. However, although it is easy to imagine how the non-Latin options might work, I have not yet been able to come up with an example where Excel uses any of them. In particular, if I use a theme font which does not support language X, and I use Language X in a cell bound to the theme, Excel will use a substitution font which does support it, but the font which it uses does not seem to be chosen from the alternatives supplied in the theme.

* Scrutinizer

The sun rises in the east, and Scrutinizer issues more false positives.
2023-03-31 17:12:37 -07:00
Mark Baker ab83bfab88 Merge pull request #3496 from PHPOffice/CalcEngine-Improved-Range-Logging
Add result logging for Range operator
2023-03-31 20:12:51 +02:00
Mark Baker 1781baae25 Merge branch 'master' into CalcEngine-Improved-Range-Logging 2023-03-31 19:45:23 +02:00
MarkBaker 0eef2c9d29 Add result logging for Range operator 2023-03-31 19:28:59 +02:00
Mark Baker e35b39a9c9 Merge pull request #3482 from PHPOffice/Xlsx-Reader_Windows-Folder-Separator-in-Zip
Handle zips with Windoze directory separators (`\`) rather than the standard linux (`/`)
2023-03-31 13:32:47 +02:00
Mark Baker b48232c616 Merge branch 'master' into Xlsx-Reader_Windows-Folder-Separator-in-Zip 2023-03-31 12:56:02 +02:00
MarkBaker 5bd3be8190 Some optimisation and refactoring of the code logic for evaluating a cell when accessed via the toArray() methods 2023-03-30 23:34:03 +02:00
MarkBaker 41fd431acc Allow CellRange and CellAddress objects for the range argument in the rangeToArray() method. 2023-03-30 22:03:25 +02:00
MarkBaker e1b73dcaf5 Provide an Ignore/Return Hidden rows/columns option to the toArray() methods 2023-03-30 22:00:34 +02:00
MarkBaker e5ed056b81 Provide an Ignore/Return Hidden rows/columns option to the toArray() methods 2023-03-30 18:18:46 +02:00
MarkBaker 661bba8d83 Improvements to AutoFilter Examples 2023-03-29 23:47:35 +02:00
Mark Baker 00c34e71e6 Merge pull request #3488 from PHPOffice/Examples-General-Improvements
Examples general improvements
2023-03-29 22:55:16 +02:00
Mark Baker 78c09b09a2 Merge branch 'master' into Examples-General-Improvements 2023-03-29 22:36:27 +02:00
MarkBaker 7d7e616567 Style and typing fixes 2023-03-29 20:05:52 +02:00
MarkBaker e10c286239 Refactor Downloader as a Helper class 2023-03-29 17:05:30 +02:00
MarkBaker b392613ad4 Provide download link for server-generated files while web viewing 2023-03-29 11:44:15 +02:00
MarkBaker b90c0a625c Format "grid" layouts for web viewing 2023-03-29 11:30:26 +02:00