var $y;
var $numcols;
var $excelColWidthFactor;
+ var $endLine;
var $formatTitle;
var $formatDateTime;
$this->size = $size;
$this->title = $title;
$this->lineHeight = 12;
+ $this->endLine = 760;
$this->fontSize = $fontsize;
$this->oldFontSize = 0;
$this->y = 1;
$this->sheet->mergeCells($this->y, $c, $this->y, $n - 1);
}
- function AmountCol($c, $n, $txt, $dec=0, $corr=0, $r=0, $border=0, $fill=0, $link=NULL, $stretch=0)
+ function AmountCol($c, $n, $txt, $dec=0, $corr=0, $r=0, $border=0, $fill=0, $link=NULL, $stretch=0, $color_red=false)
{
if (!is_numeric($txt))
$txt = 0;
$this->sheet->writeNumber($this->y, $c, $txt, $this->NumFormat($dec));
}
- function AmountCol2($c, $n, $txt, $dec=0, $corr=0, $r=0, $border=0, $fill=0, $link=NULL, $stretch=0, $amount_locale = NULL, $amount_format = NULL)
+ function AmountCol2($c, $n, $txt, $dec=0, $corr=0, $r=0, $border=0, $fill=0, $link=NULL, $stretch=0, $color_red=false, $amount_locale = NULL, $amount_format = NULL)
{
if (!is_numeric($txt))
$txt = 0;
return $this->TextWrap($this->cols[$c], $this->row - $r, $this->cols[$n] - $this->cols[$c] + $corr, $txt, $this->aligns[$c], $border, $fill, $link, $stretch);
}
- function AmountCol($c, $n, $txt, $dec=0, $corr=0, $r=0, $border=0, $fill=0, $link=NULL, $stretch=0)
+ function AmountCol($c, $n, $txt, $dec=0, $corr=0, $r=0, $border=0, $fill=0, $link=NULL, $stretch=0, $color_red=false)
{
- return $this->TextCol($c, $n, number_format2($txt, $dec), $corr, $r, $border, $fill, $link, $stretch);
+ if ($color_red && $txt < 0)
+ $this->SetTextColor(255, 0, 0);
+ $ret = $this->TextCol($c, $n, number_format2($txt, $dec), $corr, $r, $border, $fill, $link, $stretch);
+ if ($color_red && $txt < 0)
+ $this->SetTextColor(0, 0, 0);
+ return $ret;
}
- function AmountCol2($c, $n, $txt, $dec=0, $corr=0, $r=0, $border=0, $fill=0, $link=NULL, $stretch=0, $amount_locale = 'en_US.UTF-8', $amount_format = '%(!.2n')
+ function AmountCol2($c, $n, $txt, $dec=0, $corr=0, $r=0, $border=0, $fill=0, $link=NULL, $stretch=0, $color_red=false, $amount_locale = 'en_US.UTF-8', $amount_format = '%(!.2n')
{
setlocale(LC_MONETARY, $amount_locale);
- return $this->TextCol($c, $n, money_format($amount_format, $txt), $corr, $r, $border, $fill, $link, $stretch);
+ if ($color_red && $txt < 0)
+ $this->SetTextColor(255, 0, 0);
+ $ret = $this->TextCol($c, $n, money_format($amount_format, $txt), $corr, $r, $border, $fill, $link, $stretch);
+ if ($color_red && $txt < 0)
+ $this->SetTextColor(0, 0, 0);
+ return $ret;
}
function DateCol($c, $n, $txt, $conv=false, $corr=0, $r=0, $border=0, $fill=0, $link=NULL, $stretch=0)