From f9223087df7a42cc7ac67f080b8167d0460ffae6 Mon Sep 17 00:00:00 2001 From: yuri Date: Wed, 5 Jun 2019 11:26:46 +0300 Subject: [PATCH] xlsx export array --- application/Espo/Core/Export/Xlsx.php | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/application/Espo/Core/Export/Xlsx.php b/application/Espo/Core/Export/Xlsx.php index 6e6fe3b7e4..7a30e48af2 100644 --- a/application/Espo/Core/Export/Xlsx.php +++ b/application/Espo/Core/Export/Xlsx.php @@ -491,7 +491,14 @@ class Xlsx extends \Espo\Core\Injectable $sheet->setCellValue("$col$rowNumber", $value); } - + } else if ($type == 'multiEnum' || $type == 'array') { + if (!empty($row[$name])) { + $array = json_decode($row[$name]); + if (is_array($array)) { + $value = implode(', ', $array); + $sheet->setCellValue("$col$rowNumber", $value, \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING); + } + } } else { if (array_key_exists($name, $row)) { $sheet->setCellValueExplicit("$col$rowNumber", $row[$name], \PhpOffice\PhpSpreadsheet\Cell\DataType::TYPE_STRING);