You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Able to reproduce the behaviour outside of your code, the problem is isolated to Laravel Excel.
Checked that your issue isn't already filed.
Checked if no PR was submitted that fixes this problem.
Versions
PHP version: 7.2
Laravel version: 5.5
Package version: 3.0.1
Description
Multiple Sheets not working if any/all sheets are FromView
all sheets implementing FromView (not working)
1 sheet FromView and another implementing FromCollection (not working)
all sheets not implementing FromView (working fine)
Steps to Reproduce (attaching my codes)
`
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';
}
Prerequisites
Versions
Description
Multiple Sheets not working if any/all sheets are FromView
Steps to Reproduce (attaching my codes)
`
class FormatReportExport implements WithMultipleSheets, Responsable
{
use Exportable;
}
`
`
class ReportSummaryExport implements FromCollection, WithTitle
{
protected $summary;
}`
`class ReportExport implements FromView, WithTitle
{
protected $reports;
}`
list.blade.php
`@extends('layouts.export', ['title' => $title])
@section('content')
@foreach($reports as $report) @Endforeach@endsection`
Expected behavior:
Excel file with multiple sheets based on the views.
Actual behavior:
The text was updated successfully, but these errors were encountered: