Multiple Sheets not working if any/all sheets are FromView
`
class FormatReportExport implements WithMultipleSheets, Responsable
{
use Exportable;
protected $reports;
protected $summary;
public function __construct($summary, $reports)
{
$this->summary = $summary;
$this->reports = $reports;
}
public function sheets(): array
{
$sheets = [];
$sheets[] = new ReportSummaryExport($this->summary);
$sheets[] = new ReportExport($this->reports);
return $sheets;
}
}
`
`
class ReportSummaryExport implements FromCollection, WithTitle
{
protected $summary;
public function __construct($summary)
{
$this->summary = $summary;
}
public function collection()
{
return User::get();
}
/**
* @return string
*/
public function title(): string
{
return 'Summary';
}
}`
`class ReportExport implements FromView, WithTitle
{
protected $reports;
public function __construct($reports)
{
$this->reports = $reports;
}
public function view(): View
{
return view('export.report.list', [
'title' => $this->title(),
'reports' => $this->reports
]);
}
/**
* @return string
*/
public function title(): string
{
return 'Checklists';
}
}`
list.blade.php
`@extends('layouts.export', ['title' => $title])
@section('content')
Date Created |
{{ $report['created_at'] }} |
@endsection`
Expected behavior:
Excel file with multiple sheets based on the views.
Actual behavior:
Thanks for submitting the ticket. We will pick it up as soon as we have resources available (as stated in our support guidelines (https://laravel-excel.maatwebsite.nl/docs/3.0/getting-started/support)).
Will most likely be solved by #1590
Most helpful comment
https://github.com/Maatwebsite/Laravel-Excel/releases/tag/3.0.2