From 0dd6e27d8f8b4c7963698e5dc8f2864887a54d0a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Przemys=C5=82aw=20Szustak?= Date: Mon, 15 Apr 2019 21:32:22 +0200 Subject: [PATCH] Conditional formatting - support for Conditional::CONDITION_CONTAINSBLANKS (#883) Condition formating option was not supported. I unziped xlsx and found this formula to option blank field --- src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php b/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php index 9600b1d0..7f48a6c1 100644 --- a/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php +++ b/src/PhpSpreadsheet/Writer/Xlsx/Worksheet.php @@ -519,6 +519,9 @@ class Worksheet extends WriterPart // Formula $objWriter->writeElement('formula', $formula); } + } elseif ($conditional->getConditionType() == Conditional::CONDITION_CONTAINSBLANKS) { + // formula copied from ms xlsx xml source file + $objWriter->writeElement('formula', 'LEN(TRIM(' . $cellCoordinate . '))=0'); } $objWriter->endElement();