I'm trying to set a cell value to TRUE
or FALSE
with PhpSpreadsheet 1.16.0, but the result is not what I want.
My code:
$sheet->getCell('A1')
->setValueExplicit(true, DataType::TYPE_BOOL);
This is what I get when I open the file with LibreOffice Calc 7.0 or 7.1:
As you can see, the cell shows a formula =TRUE()
(or =FALSE()
) instead of the native XLSX "boolean" type.
The cell itself has type "Number", instead of the expected "Boolean Value":
This looks easy enough, but I can't figure it out what I'm doing wrong.