Closed peteshew closed 3 years ago
In ended up fixing this myself:
private function boolToStr($value){
return $value ? 'true' : 'false';
}
...
$sheet->file_writer->write('<row collapsed="'.$this->boolToStr($collapsed).
'" customHeight="'.$this->boolToStr($customHt).
'" hidden="'.$this->boolToStr($hidden).
'" ht="'.($ht).
'" outlineLevel="0" r="' . ($sheet->row_count + 1) . '">');
A more elegant solution then mine, but the effect is the same.
The code in writeSheetRow to handle row options sets values to false or true in some cases. Looking at the non row option code just below, these should be set to "false" or "true" including the quotes as string values not boolean ones.
Without this change, using row options always causes an error when loading the resultant xlsx into Excel 2007 as it doesn't seem to like empty values which is what results, e.g. hidden="" rather than hidden="false"
I suspect that the casting to (bool) may also cause problems but I haven' t yet been there as I am not sure how the hidden and collapsed options are specified (or even what they mean).