support subtotal in filtered spreadsheet (#3166)

This commit is contained in:
fredyb
2022-02-22 13:29:03 +01:00
committed by GitHub
parent 7f8545f1dc
commit d7066a2bbc

View File

@@ -187,7 +187,7 @@ abstract class AbstractSpreadsheetRenderer
protected function setDurationTotal(Worksheet $sheet, $column, $row, $startCoordinate, $endCoordinate)
{
$sheet->setCellValueByColumnAndRow($column, $row, sprintf('=SUM(%s:%s)', $startCoordinate, $endCoordinate));
$sheet->setCellValueByColumnAndRow($column, $row, sprintf('=SUBTOTAL(9,%s:%s)', $startCoordinate, $endCoordinate));
$style = $sheet->getStyleByColumnAndRow($column, $row);
$style->getNumberFormat()->setFormatCode($this->durationFormat);
}
@@ -203,7 +203,7 @@ abstract class AbstractSpreadsheetRenderer
protected function setRateTotal(Worksheet $sheet, $column, $row, $startCoordinate, $endCoordinate)
{
$sheet->setCellValueByColumnAndRow($column, $row, sprintf('=SUM(%s:%s)', $startCoordinate, $endCoordinate));
$sheet->setCellValueByColumnAndRow($column, $row, sprintf('=SUBTOTAL(9,%s:%s)', $startCoordinate, $endCoordinate));
}
protected function setRateStyle(Worksheet $sheet, $column, $row, $rate, $currency)