mk-j / PHP_XLSXWriter

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

Avoiding error when using writeToStdOut/String with an empty document. #233

Closed Dj1b closed 4 years ago

Dj1b commented 5 years ago

As writeToFile doesn’t create a temp file on empty document, resulting in an error, we assure to have at least one cell written for writeToStdOut and writeToString methods.

elminson commented 5 years ago

Quick Question @Dj1b This repository is dead? I just saw PR from 2016 and nothing happen, I wanna contribute but is look dead. I wanna take over

elminson commented 5 years ago

@Dj1b check this out, I just convert this class as composer package with a Standard structure + adding phpunit https://github.com/elminson/PHP_XLSXWriter

mk-j commented 4 years ago

This is a really rare use case, to want to write an empty spreadsheet file. The way to do this is to make initializeSheet() public and then call that.

$writer = new XLSXWriter();
$writer->initializeSheet('Sheet1');
$writer->writeToFile('example.xlsx');