Open tmilos opened 8 years ago
Feel free to open a PR!
The following works for me:
$writer
->prepare()
->writeItem(array('first', 'last'));
unset($file);
$writer->finish();
How does you resolve that problem of export file in excel: Warning : unlink(D:\test\data.xlsx): Permission denied in in vendor\phpoffice\phpexcel\Classes\PHPExcel\Writer\Excel2007.php at line 236 .
`$workflow = new Workflow($reader);
$file = new \SplFileObject('D:\test\data.xlsx', 'w');
$writer = new ExcelWriter($file);
$workflow->addWriter($writer);
$workflow->process();`
ExcelWriter
takes\SplFileObject
as argument in constructor, but use it only to take filename. By default it usesExcel2007
type, which if file exists, unlinks it before reopening it, which results in error since SplFileObject created the file and opened handle on it.Suggested solution, change ExcelWriter::__constructor to take argument
string filename, rathen then
\SplFileObject $file``