mk-j / PHP_XLSXWriter

Lightweight XLSX Excel Spreadsheet Writer in PHP
MIT License
1.84k stars 665 forks source link

Cannot create xlsx file with more than 1024 columns #218

Closed lourdas closed 6 years ago

lourdas commented 6 years ago

As the subject. Example code:

$writer = new XLSXWriter();
$sheet1 = 'mysheet';
$data = [];
for ($i = 0; $i < 2048; $i++) {
    $data[] = 'column' . $i);
}
$writer->writeSheet([$data], $sheet1);
$writer->writeToFile('/tmp/test.xlsx');

Upon opening the file in Libreoffice, a warning is displayed that the data could not be fully loaded, since the sheet exceeds the maximum number of columns.

Am I missing something here?

lourdas commented 6 years ago

It might be possible that xlsxwriter is not at fault here. I see there's an open bug for Libreoffice to support sheets with more than 1024 columns. There's an open bug for it.

However, I will create the file and test it against Excel 2007.

lourdas commented 6 years ago

Yeap. Tested Excel versions 2010 and 2013 and the generated xlsx file contains 16384 columns. Sorry for the noise.