Rerun
[fa-stable.git] / reporting / includes / excel_report.inc
index dde397bd8d9764bd64060c303fdd221220f26151..c24c09a5d30c1bac1ff3b91896d21167f9fa3984 100644 (file)
@@ -43,6 +43,7 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook
        var $y;
        var $numcols;
        var $excelColWidthFactor;
+       var $endLine;
 
        var $formatTitle;
        var $formatDateTime;
@@ -66,9 +67,10 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook
                $this->size = $size;
                $this->title = $title;
                $this->lineHeight = 12;
+               $this->endLine = 760;
                $this->fontSize = $fontsize;
                $this->oldFontSize = 0;
-               $this->y = 1;
+               $this->y = 0;
                $this->currency = '';
                $this->excelColWidthFactor = $excelColWidthFactor;
                $rtl = ($_SESSION['language']->dir == 'rtl');
@@ -234,7 +236,6 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook
 
        function Header()
        {
-               $this->y = 0;
                $tcol = $this->numcols - 1;
                $this->sheet->setRow($this->y, 20);
                for ($i = 0; $i < $this->numcols; $i++)
@@ -521,6 +522,7 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook
 
        function TextCol($c, $n, $txt, $corr=0, $r=0, $border=0, $fill=0, $link=NULL, $stretch=0)
        {
+               $txt = html_entity_decode($txt);        
                if ($this->aligns[$c] == 'right')
                        $this->sheet->writeString($this->y, $c, $txt, $this->formatRight);
                else    
@@ -529,14 +531,14 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook
                        $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;
@@ -554,6 +556,7 @@ class FrontReport extends Spreadsheet_Excel_Writer_Workbook
 
        function TextCol2($c, $n, $txt, $corr=0, $r=0, $border=0, $fill=0, $link=NULL, $stretch=0)
        {
+               $txt = html_entity_decode($txt);        
                $this->sheet->writeString($this->y, $c, $txt, $this->formatLeft);
                if ($n - $c > 1)
                        $this->sheet->mergeCells($this->y, $c, $this->y, $n - 1);