Merge fix for reports

This commit is contained in:
Hillel Coren 2017-12-11 13:03:28 +02:00
parent 1bbd36232c
commit c7cb72546f

View File

@ -202,25 +202,27 @@ class ReportController extends BaseController
$sheet->setAutoSize(true); $sheet->setAutoSize(true);
}); });
$excel->sheet(trans("texts.totals"), function($sheet) use($report, $summary, $format) { if (count($summary)) {
$sheet->setOrientation('landscape'); $excel->sheet(trans("texts.totals"), function($sheet) use($report, $summary, $format) {
$sheet->freezeFirstRow(); $sheet->setOrientation('landscape');
$sheet->freezeFirstRow();
if ($format == 'pdf') { if ($format == 'pdf') {
$sheet->setAllBorders('thin'); $sheet->setAllBorders('thin');
} }
$sheet->rows($summary); $sheet->rows($summary);
// Styling header // Styling header
$sheet->cells('A1:'.Utils::num2alpha(count($summary[0])-1).'1', function($cells) { $sheet->cells('A1:'.Utils::num2alpha(count($summary[0])-1).'1', function($cells) {
$cells->setBackground('#777777'); $cells->setBackground('#777777');
$cells->setFontColor('#FFFFFF'); $cells->setFontColor('#FFFFFF');
$cells->setFontSize(13); $cells->setFontSize(13);
$cells->setFontFamily('Calibri'); $cells->setFontFamily('Calibri');
$cells->setFontWeight('bold'); $cells->setFontWeight('bold');
});
$sheet->setAutoSize(true);
}); });
$sheet->setAutoSize(true); }
});
})->export($format); })->export($format);
} }