1
0
mirror of https://github.com/invoiceninja/invoiceninja.git synced 2024-11-10 13:12:50 +01:00

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);
});
$excel->sheet(trans("texts.totals"), function($sheet) use($report, $summary, $format) {
$sheet->setOrientation('landscape');
$sheet->freezeFirstRow();
if (count($summary)) {
$excel->sheet(trans("texts.totals"), function($sheet) use($report, $summary, $format) {
$sheet->setOrientation('landscape');
$sheet->freezeFirstRow();
if ($format == 'pdf') {
$sheet->setAllBorders('thin');
}
$sheet->rows($summary);
if ($format == 'pdf') {
$sheet->setAllBorders('thin');
}
$sheet->rows($summary);
// Styling header
$sheet->cells('A1:'.Utils::num2alpha(count($summary[0])-1).'1', function($cells) {
$cells->setBackground('#777777');
$cells->setFontColor('#FFFFFF');
$cells->setFontSize(13);
$cells->setFontFamily('Calibri');
$cells->setFontWeight('bold');
// Styling header
$sheet->cells('A1:'.Utils::num2alpha(count($summary[0])-1).'1', function($cells) {
$cells->setBackground('#777777');
$cells->setFontColor('#FFFFFF');
$cells->setFontSize(13);
$cells->setFontFamily('Calibri');
$cells->setFontWeight('bold');
});
$sheet->setAutoSize(true);
});
$sheet->setAutoSize(true);
});
}
})->export($format);
}