From eba98fd51d12fe6bd87b44a51c9755259184d097 Mon Sep 17 00:00:00 2001 From: Xenomporio <> Date: Mon, 23 May 2022 22:47:19 +0200 Subject: [PATCH] Bugfixes Report x --- classes/Modules/Report/Bootstrap.php | 2 +- classes/Modules/Report/ReportPdfExportService.php | 8 +++++++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/classes/Modules/Report/Bootstrap.php b/classes/Modules/Report/Bootstrap.php index 59c8d010..27b8db07 100644 --- a/classes/Modules/Report/Bootstrap.php +++ b/classes/Modules/Report/Bootstrap.php @@ -170,7 +170,7 @@ final class Bootstrap * * @return ReportColumnFormatter */ - public function onInitReportColumnFormatter(ContainerInterface $container): ReportColumnFormatter + public static function onInitReportColumnFormatter(ContainerInterface $container): ReportColumnFormatter { return new ReportColumnFormatter(); } diff --git a/classes/Modules/Report/ReportPdfExportService.php b/classes/Modules/Report/ReportPdfExportService.php index 6cd6fe82..424aa455 100644 --- a/classes/Modules/Report/ReportPdfExportService.php +++ b/classes/Modules/Report/ReportPdfExportService.php @@ -88,10 +88,16 @@ class ReportPdfExportService extends AbstractReportExportService $prepareHeaderLine = false; } + if (gettype($columnKey != 'int')) + { + $columnKey = 0; + } + $keyint = $columnKey + 1; + $columnCounter = 0; foreach($row as $columnKey=>$columnValue){ $pdf->Cell($colWidths[$columnCounter],6,$this->stringReadyForPdf($columnValue),'LRTB',0,$colAligns[$columnCounter],true); - if(!empty($sumcolsa) && in_array($columnKey+1,$sumcolsa, false)) + if(!empty($sumcolsa) && in_array($keyint,$sumcolsa, false)) { if(empty($sums[$columnKey])){ $sums[$columnKey] = 0;