أوراق متعددة لا تعمل إذا كان أي منها / كل الأوراق من FromView
"
فئة FormatReportExport تنفذ WithMultipleSheets ، Responsable
{
استخدام قابل للتصدير ؛
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;
}
}
"
"
فئة ReportSummaryExport تنفذ FromCollection ، WithTitle
{
ملخص $ المحمي ؛
public function __construct($summary)
{
$this->summary = $summary;
}
public function collection()
{
return User::get();
}
/**
* <strong i="34">@return</strong> string
*/
public function title(): string
{
return 'Summary';
}
} `
`فئة ReportExport تنفذ FromView ، WithTitle
{
تقارير محمية بالدولار الأمريكي ؛
public function __construct($reports)
{
$this->reports = $reports;
}
public function view(): View
{
return view('export.report.list', [
'title' => $this->title(),
'reports' => $this->reports
]);
}
/**
* <strong i="41">@return</strong> string
*/
public function title(): string
{
return 'Checklists';
}
} `
list.blade.php
"extends ('layouts.export'، ['title' => $ title])
section ("محتوى")
تاريخ الإنشاء |
{{$ report ['created_at']}} |
@ endection`
سلوك متوقع:
ملف Excel مع أوراق متعددة بناءً على طرق العرض.
السلوك الفعلي:
شكرا لتقديم التذكرة. سنقوم باستلامه بمجرد توفر الموارد (كما هو مذكور في إرشادات الدعم الخاصة بنا (https://laravel-excel.maatwebsite.nl/docs/3.0/getting-started/support)).
سيتم حلها على الأرجح بواسطة # 1590
التعليق الأكثر فائدة
https://github.com/Maatwebsite/Laravel-Excel/releases/tag/3.0.2