PhpSpreadsheet/samples/Basic
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
..
data/continents Merge all examples together 2017-10-01 17:48:59 +09:00
01_Simple.php Removed unnecessary object creation. (#1430) 2020-04-27 12:02:49 +02:00
01_Simple_download_ods.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
01_Simple_download_pdf.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
01_Simple_download_xls.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
01_Simple_download_xlsx.php Keep sample bootstrap purely in samples 2020-05-17 18:51:13 +09:00
02_Types.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
03_Formulas.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
04_Printing.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
05_Feature_demo.php Merge all examples together 2017-10-01 17:48:59 +09:00
06_Largescale.php Merge all examples together 2017-10-01 17:48:59 +09:00
07_Reader.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
08_Conditional_formatting.php Upgrade to latest PHP_CodeSniffer 2018-08-06 11:02:16 +09:00
08_Conditional_formatting_2.php Upgrade to latest PHP_CodeSniffer 2018-08-06 11:02:16 +09:00
09_Pagebreaks.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
11_Documentsecurity.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
12_CellProtection.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
13_Calculation.php PSR12 code style 2020-07-26 14:13:11 +09:00
13_CalculationCyclicFormulae.php PSR12 code style 2020-07-26 14:13:11 +09:00
14_Xls.php Merge all examples together 2017-10-01 17:48:59 +09:00
15_Datavalidation.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
16_Csv.php Fix for Issue 2042 (SUM Partially Broken) (#2045) 2021-05-03 18:31:01 +02:00
17_Html.php Merge all examples together 2017-10-01 17:48:59 +09:00
17a_Html.php Improve HTML Writer (#1464) 2020-05-18 12:43:18 +09:00
17b_Html.php Different Example for Callback 2020-06-09 00:22:22 -07:00
18_Extendedcalculation.php Rename classes to keep them in their related namespaces 2017-10-29 17:39:42 +09:00
19_Namedrange.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
20_Read_Excel2003XML.php Improving Coverage for Excel2003 XML Reader (#1557) 2020-10-11 13:26:56 +02:00
20_Read_Gnumeric.php Merge all examples together 2017-10-01 17:48:59 +09:00
20_Read_Ods.php Merge all examples together 2017-10-01 17:48:59 +09:00
20_Read_Sylk.php Merge all examples together 2017-10-01 17:48:59 +09:00
20_Read_Xls.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
22_Heavily_formatted.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
23_Sharedstyles.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
24_Readfilter.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
25_In_memory_image.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
26_Utf8.php Remove tests that include tcPDF and DomPDF libraries when running against PHP8, because neither library is yet PHP8-ready 2020-10-09 14:31:16 +02:00
27_Images_Xls.php Merge all examples together 2017-10-01 17:48:59 +09:00
28_Iterator.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
29_Advanced_value_binder.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
30_Template.php Update PHP-CS-Fixer rules 2020-05-18 13:49:57 +09:00
30_Templatebiff5.php Stacked Alignment - Use Class Constant Rather than Literal (#1716) 2021-02-03 23:53:04 +01:00
31_Document_properties_write.php Minor improvements (#1028) 2019-06-22 21:24:51 +02:00
31_Document_properties_write_xls.php Minor improvements (#1028) 2019-06-22 21:24:51 +02:00
37_Page_layout_view.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
38_Clone_worksheet.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
39_Dropdown.php Update to PHP-CS-Fixer 2.10 2018-01-28 15:59:38 +09:00
40_Duplicate_style.php Additional conditionals from math trig (#1885) 2021-02-28 10:24:33 +01:00
41_Password.php Merge all examples together 2017-10-01 17:48:59 +09:00
42_RichText.php Improve Coverage for HTML Reader 2020-06-25 22:42:38 -07:00
43_Merge_workbooks.php Initial Formula Translation tests (#1886) 2021-02-28 13:18:51 +01:00
44_Worksheet_info.php Testing - Delete Temp Files When No Longer Needed (#1488) 2020-05-24 20:03:07 +09:00
45_Quadratic_equation_solver.php PSR12 code style 2020-07-26 14:13:11 +09:00
46_ReadHtml.php Merge all examples together 2017-10-01 17:48:59 +09:00