Laravel-excel: WithMultipleSheets HTML writeAllSheets

Created on 10 Nov 2018  路  4Comments  路  Source: Maatwebsite/Laravel-Excel

Prerequisites

Versions

  • PHP version: 7.1.22
  • Laravel version: 5.5
  • Package version: 3.1

Description

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

enhancement

Most helpful comment

I'll see if I can change that

All 4 comments

@spout you can access the Writer via an Event: https://laravel-excel.maatwebsite.nl/3.1/exports/extending.html

I'll see if I can change that

Next release will write all html sheets

Was this page helpful?
0 / 5 - 0 ratings