PhpSpreadsheet/samples
oleibman 346bad1b1d
Fix for Issue 2042 (SUM Partially Broken) (#2045)
As issue #2042 documents, SUM behaves differently with invalid strings depending on whether they come from a cell or are used as literals in the formula. SUM is not alone in this regard; COUNTA is another function within this behavior, and the solution to this one is modeled on COUNTA. New tests are added for SUM, and the resulting tests are duplicated to confirm correct behavior for both cells and literals.

Samples 16 (CSV), 17 (Html), and 21 (PDF) were adversely affected by this problem. 17 and 21 were immediately fixed, but 16 had another problem - Excel was not interpreting the UTF8 currency symbols correctly, even though the file was saved with a BOM. After some experimenting, it appears that the `sep=;` line generated by setExcelCompatibility(true) causes Excel to mis-handle the file. This seems like a bug - there is apparently no way to save a UTF-8 CSV with non-ASCII characters which specifies a non-standard separator which Excel will open correctly. I don't know if this is a recent change or if it is just the case that nobody noticed this problem till now. So, I changed Sample 16 to use setUseBom rather than setExcelCompatibility, which solved its problem. I then added new tests for setExcelCompatibility, with documentation of this problem.
2021-05-03 18:31:01 +02:00
..
Autofilter Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
Basic Fix for Issue 2042 (SUM Partially Broken) (#2045) 2021-05-03 18:31:01 +02:00
Calculations Financial functions more rationalization (#1990) 2021-04-12 22:08:58 +02:00
Chart jpgraph seems to be finally dying with PHP. (#1926) 2021-03-15 14:14:44 +01:00
DefinedNames Make DefinedNames Samples Consistent With Other Samples (#1707) 2020-11-11 11:02:04 +01:00
Pdf Codestyle clean-ups 2020-10-09 16:08:20 +02:00
Reader Reduce PHPStan error in tests 2021-04-12 11:10:23 +09:00
Reading_workbook_data Upgrade to latest PHP_CodeSniffer 2018-08-06 11:02:16 +09:00
bootstrap Reorganize code samples 2016-09-01 01:17:13 +09:00
images Xls Writer - Correct Timestamp Bug, Improve Coverage (#1493) 2020-06-19 21:08:36 +02:00
templates Use DateTime Rather than gmmktime in Sample Template (#1827) 2021-02-14 18:54:49 +01:00
Bootstrap.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
Header.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
index.php Drop PHP 7.1 2020-04-27 18:42:32 +09:00