Skip to content
Snippets Groups Projects
Commit 54536db2 authored by bgm's avatar bgm Committed by bgm
Browse files

SearchExport: do not setCellValueExplicit to TYPE_NUMERIC if the value has a...

SearchExport: do not setCellValueExplicit to TYPE_NUMERIC if the value has a leading value (avoid data loss)
parent 78bc43ca
No related branches found
No related tags found
No related merge requests found
......@@ -111,7 +111,8 @@ class CRM_CiviExportExcel_Utils_SearchExport {
$value = html_entity_decode(strip_tags($value));
// We use this to guard against special chars that phpspreadsheet might think are formulas
if (is_numeric($value)) {
// Also avoid converting to numeric if there is a leading zero, because Excel will remove it.
if (is_numeric($value) && $value[0] != "0") {
$objPHPExcel->getActiveSheet()
->setCellValueExplicit($cells[$col] . $cpt, $value, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_NUMERIC);
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment