Décalage de la ligne TOTAL en raison de l'ajout d'une colonne demandeur
This commit is contained in:
parent
cec0d34761
commit
4d7d3da97d
@ -145,13 +145,16 @@ foreach (range('A','E') as $col) {
|
|||||||
// Add totals
|
// Add totals
|
||||||
//
|
//
|
||||||
$highestRow = $spreadsheet->getActiveSheet()->getHighestRow();
|
$highestRow = $spreadsheet->getActiveSheet()->getHighestRow();
|
||||||
$coord = 'N' . ($highestRow+2);
|
$coord = 'O' . ($highestRow+2);
|
||||||
$spreadsheet->getActiveSheet()->setCellValue($coord, 'TOTAL');
|
$spreadsheet->getActiveSheet()->setCellValue($coord, 'TOTAL');
|
||||||
foreach(range('O','Z') as $col) {
|
foreach(range('P','Z') as $col) {
|
||||||
$spreadsheet->getActiveSheet()->setCellValue($col.($highestRow+2), '=SUM('.$col.'2:'.$col.($highestRow).')');
|
$spreadsheet->getActiveSheet()->setCellValue($col.($highestRow+2), '=SUM('.$col.'2:'.$col.($highestRow).')');
|
||||||
}
|
}
|
||||||
// Do AA
|
foreach(range('A','B') as $col) {
|
||||||
$spreadsheet->getActiveSheet()->setCellValue('AA'.($highestRow+2), '=SUM(AA2:AA'.($highestRow).')');
|
$spreadsheet->getActiveSheet()->setCellValue('A'.$col.($highestRow+2), '=SUM(A'.$col.'2:A'.$col.($highestRow).')');
|
||||||
|
}
|
||||||
|
// Do AA and AB
|
||||||
|
// $spreadsheet->getActiveSheet()->setCellValue('AA'.($highestRow+2), '=SUM(AA2:AA'.($highestRow).')');
|
||||||
// Format the total
|
// Format the total
|
||||||
$spreadsheet->getActiveSheet()->getStyle($coord.':AA'.($highestRow+2))->getFill()
|
$spreadsheet->getActiveSheet()->getStyle($coord.':AA'.($highestRow+2))->getFill()
|
||||||
->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)
|
->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)
|
||||||
@ -199,13 +202,17 @@ if ($result = $mysqli->query($query)) {
|
|||||||
// Add totals
|
// Add totals
|
||||||
// //
|
// //
|
||||||
$highestRow = $prevSheet->getHighestRow();
|
$highestRow = $prevSheet->getHighestRow();
|
||||||
$coord = 'N' . ($highestRow+2);
|
$coord = 'O' . ($highestRow+2);
|
||||||
$prevSheet->setCellValue($coord, 'TOTAL');
|
$prevSheet->setCellValue($coord, 'TOTAL');
|
||||||
foreach(range('O','Z') as $col) {
|
foreach(range('P','Z') as $col) {
|
||||||
$prevSheet->setCellValue($col.($highestRow+2), '=SUM('.$col.'2:'.$col.($highestRow).')');
|
$prevSheet->setCellValue($col.($highestRow+2), '=SUM('.$col.'2:'.$col.($highestRow).')');
|
||||||
}
|
}
|
||||||
// Do AA
|
// Do AA
|
||||||
$prevSheet->setCellValue('AA'.($highestRow+2), '=SUM(AA2:AA'.($highestRow).')');
|
foreach(range('A','B') as $col) {
|
||||||
|
$prevSheet->setCellValue('A'.$col.($highestRow+2), '=SUM(A'.$col.'2:A'.$col.($highestRow).')');
|
||||||
|
}
|
||||||
|
|
||||||
|
// $prevSheet->setCellValue('AA'.($highestRow+2), '=SUM(AA2:AA'.($highestRow).')');
|
||||||
// Format the total
|
// Format the total
|
||||||
$prevSheet->getStyle($coord.':AA'.($highestRow+2))->getFill()
|
$prevSheet->getStyle($coord.':AA'.($highestRow+2))->getFill()
|
||||||
->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)
|
->setFillType(\PhpOffice\PhpSpreadsheet\Style\Fill::FILL_SOLID)
|
||||||
@ -250,9 +257,9 @@ foreach (range('A','E') as $col) {
|
|||||||
// Add totals
|
// Add totals
|
||||||
// //
|
// //
|
||||||
$highestRow = $spreadsheet->getActiveSheet()->getHighestRow();
|
$highestRow = $spreadsheet->getActiveSheet()->getHighestRow();
|
||||||
$coord = 'N' . ($highestRow+2);
|
$coord = 'O' . ($highestRow+2);
|
||||||
$spreadsheet->getActiveSheet()->setCellValue($coord, 'TOTAL');
|
$spreadsheet->getActiveSheet()->setCellValue($coord, 'TOTAL');
|
||||||
foreach(range('O','Z') as $col) {
|
foreach(range('P','Z') as $col) {
|
||||||
$spreadsheet->getActiveSheet()->setCellValue($col.($highestRow+2), '=SUM('.$col.'2:'.$col.($highestRow).')');
|
$spreadsheet->getActiveSheet()->setCellValue($col.($highestRow+2), '=SUM('.$col.'2:'.$col.($highestRow).')');
|
||||||
}
|
}
|
||||||
// Do AA
|
// Do AA
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user