Skip to content
This repository has been archived by the owner on Jun 11, 2024. It is now read-only.

Commit

Permalink
Make column numbers 1-relative.
Browse files Browse the repository at this point in the history
  • Loading branch information
Ron Cemer committed Nov 6, 2021
1 parent 0abacce commit 4ee1fe3
Showing 1 changed file with 7 additions and 8 deletions.
15 changes: 7 additions & 8 deletions src/Report.php
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ protected function outputHeading($forceNewPage = false) {

$rowData = '';
$sep = '';
$colNum = -1;
$colNum = 0;

if ($this->outputter->outputFormat == 'html') {
$this->ensureHTMLTableSection('thead');
Expand Down Expand Up @@ -496,7 +496,7 @@ public function outputRow(&$row) {

$sep = '';
$rowData = '';
$colNum = -1;
$colNum = 0;

if ($this->outputter->outputFormat == 'html') {
$this->ensureHTMLTableSection('tbody');
Expand Down Expand Up @@ -731,7 +731,6 @@ public function outputCustomRow(

$sep = '';
$rowData = '';
$colNum = -1;

if ($this->outputter->outputFormat == 'html') {
$this->ensureHTMLTableSection(($appearance == 'heading') ? 'thead' : 'tbody');
Expand Down Expand Up @@ -786,9 +785,9 @@ public function outputCustomRow(
case 'xls':
case 'xlsx':
case 'ods':
$cell = $this->outputter->worksheet->getCellByColumnAndRow($ci, $this->outputter->worksheetRowNum);
$cell = $this->outputter->worksheet->getCellByColumnAndRow($ci+1, $this->outputter->worksheetRowNum);
$cell->setValueExplicit($text, DataType::TYPE_STRING);
$style = $this->outputter->worksheet->getStyleByColumnAndRow($ci, $this->outputter->worksheetRowNum);
$style = $this->outputter->worksheet->getStyleByColumnAndRow($ci+1, $this->outputter->worksheetRowNum);
$style->getAlignment()->setHorizontal($align);
if (($appearance == 'heading') || ($appearance == 'totals')) {
$style->getFont()->setBold(true);
Expand Down Expand Up @@ -925,7 +924,7 @@ public function outputAndResetTotals($levelIdx) {

$sep = '';
$rowData = '';
$colNum = -1;
$colNum = 0;

if ($this->outputter->outputFormat == 'html') {
$this->ensureHTMLTableSection('tbody');
Expand Down Expand Up @@ -989,9 +988,9 @@ public function outputAndResetTotals($levelIdx) {
$style->getFont()->setBold(true);
if ($nTotDescCols > 1) {
$this->outputter->worksheet->mergeCellsByColumnAndRow(
$colNum+1,
$colNum,
$this->outputter->worksheetRowNum,
$colNum+1+($nTotDescCols-1),
$colNum+($nTotDescCols-1),
$this->outputter->worksheetRowNum
);
}
Expand Down

0 comments on commit 4ee1fe3

Please sign in to comment.