Skip to content

Commit

Permalink
Fixed issue #7712: Some problems with statistics in pdf format
Browse files Browse the repository at this point in the history
  • Loading branch information
c-schmitz committed Apr 19, 2013
1 parent e512a8e commit 369581d
Showing 1 changed file with 10 additions and 7 deletions.
17 changes: 10 additions & 7 deletions application/libraries/admin/pdf.php
Expand Up @@ -449,7 +449,7 @@ function headTable($head, $table, $modulo=1 )
$maxwidth = $this->getFullWidth($array);

$this->SetFillColor(220, 220, 220);
for($a=0;$a<sizeof($array);$a++)
for($a=0;$a<sizeof($array)-2;$a++)
{
if($modulo){
if($a%2 === 0){$fill=1;}
Expand All @@ -470,7 +470,7 @@ function headTable($head, $table, $modulo=1 )
$this->SetFont($this->FontFamily, 'B', $this->FontSizePt);

if ($maxwidth[$b] > 140) $maxwidth[$b]=130;
if ($maxwidth[$b] < 20) $maxwidth[$b]=20;
if ($maxwidth[$b] < 25) $maxwidth[$b]=25;
$this->MultiCell($maxwidth[$b],6,$this->delete_html($array[$a][$b]),0,'L',1,$bEndOfCell);

$this->SetFont($this->FontFamily, $oldStyle, $this->FontSizePt);
Expand All @@ -479,20 +479,22 @@ function headTable($head, $table, $modulo=1 )
{
if ($a==1)
{
$this->SetFillColor(250, 250, 250);
$this->SetFillColor(240, 240, 240);
}
//echo $maxwidth[$b]." max $b.Spalte<br/>";

if ($maxwidth[$b] > 140) $maxwidth[$b]=130;
if ($b==0)
{
$iLines=$this->MultiCell($maxwidth[$b],6,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell);
$iHeight=$this->getStringHeight($maxwidth[$b],$this->delete_html($array[$a][$b]));
$this->MultiCell($maxwidth[$b],$iHeight,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell);
}
else
{
$this->MultiCell($maxwidth[$b],$iLines,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell);
$iLines=$this->getStringHeight($maxwidth[$b],$this->delete_html($array[$a][$b]));
if ($iLines>$iHeight) $iHeight=$iLines;
$this->MultiCell($maxwidth[$b],$iHeight,$this->delete_html($array[$a][$b]),0,'L',$fill,$bEndOfCell);
}

}
}
}
Expand Down Expand Up @@ -604,7 +606,8 @@ function write_out($name)

function delete_html($text)
{
$text = html_entity_decode($text);
$text = html_entity_decode($text,null,'UTF-8');
$text = str_replace("\t",' ',$text);
return strip_tags($text);
}
}

0 comments on commit 369581d

Please sign in to comment.