From d2029a084fe45e9902e948fe5f1b6ef0cceec6a8 Mon Sep 17 00:00:00 2001 From: Chris Graham Date: Sun, 22 Mar 2015 19:03:32 +0000 Subject: [PATCH] Fix XLSX bug with empty rows --- src/Spout/Writer/Internal/XLSX/Worksheet.php | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/src/Spout/Writer/Internal/XLSX/Worksheet.php b/src/Spout/Writer/Internal/XLSX/Worksheet.php index 326c41b..89c3f33 100644 --- a/src/Spout/Writer/Internal/XLSX/Worksheet.php +++ b/src/Spout/Writer/Internal/XLSX/Worksheet.php @@ -121,6 +121,11 @@ EOD; */ public function addRow($dataRow) { + if (count($dataRow) == 0) { + // Without this fix, we get a repair issue in regular Microsoft Excel + $dataRow=array(''); + } + $cellNumber = 0; $rowIndex = $this->lastWrittenRowIndex + 1; $numCells = count($dataRow);