After looking over the documentation for Box/Spout I do not see a way to format cells for currency.
NOTE: PhpExcel and PhpSpreadsheet are not an option.
Is there a way to format a cell?
While styling, is there a way to set the width of the cells?
This is my code so far.
It works, but is lacking currency formatting and width:
$writer = WriterFactory::create(Type::XLSX); // for XLSX files
$writer->openToFile($tmpfile); // write data to a file or to a PHP stream
$writer_sheet = $writer->getCurrentSheet();
$writer_sheet->setName($invoiceSheetName);
$headerStyle = (new StyleBuilder())
->setFontBold()
->setFontUnderline()
->build();
// add header with style
$writer->addRowWithStyle($header, $headerStyle);
$writer->addRows($resultsArray); // add multiple rows at a time
$writer->close();
$excelOutput = file_get_contents($tmpfile);
Documentation: Spout Documentation
Help is greatly appreciated.