Skip to content
Corex

XlsxExportWriter

Corex\Config\Export\XlsxExportWriter · class · Config layer

Writes an export as an Excel workbook (spec 103, FR-016). A workbook is a zip of XML. This writes the parts a spreadsheet needs and no more: one sheet per table, with a date as a date and a number as a number so they sort and filter, the heading row bold and held in view, filtering on, and each column as wide as what it holds. It is written by hand because the alternative is a library many times the size of everything else here, for a format this small a part of. What that costs is that nothing checks the file but its tests, which read it back part by part. Each sheet’s rows are read once and written to a working file as they come, so a large export is not held in memory. The widths and the range to filter are only known at the end, and the parts of the sheet that need them are written around the rows then.

write(ExportDocument $document, string $pathWithoutExtension): ExportFile

Section titled “write(ExportDocument $document, string $pathWithoutExtension): ExportFile”