Hello,
I have used the WithMultipleSheets concern, but can't find a way using events to set $writer->writeAllSheets(); for HTML writer as explained here :
https://phpspreadsheet.readthedocs.io/en/develop/topics/reading-and-writing-to-file/#html
I've seen this related issue : https://github.com/Maatwebsite/Laravel-Excel/issues/386
The only way I found is by hacking Maatwebsite\Excel\Writer in the write function :
if ($writer instanceof Html && $export instanceof WithMultipleSheets) {
$writer->writeAllSheets();
}
Is there other way to achieve this ?
Regards
@spout you can access the Writer via an Event: https://laravel-excel.maatwebsite.nl/3.1/exports/extending.html
@patrickbrouwers I've tried this, but the event beforeWriting is called before :
https://github.com/Maatwebsite/Laravel-Excel/blob/78f5bf3713db73f6ab1550cc63399fc6b24b29d9/src/Writer.php#L134
$writer instanciation :
https://github.com/Maatwebsite/Laravel-Excel/blob/78f5bf3713db73f6ab1550cc63399fc6b24b29d9/src/Writer.php#L140
I'll see if I can change that
Next release will write all html sheets
Most helpful comment
I'll see if I can change that