[Vtigercrm-commits] [vtiger-commits] r9966 - in /vtigercrm/branches/5.0.3: include/fpdf/fpdf.php modules/Reports/CreatePDF.php
vtigercrm-commits at vtiger.fosslabs.com
vtigercrm-commits at vtiger.fosslabs.com
Wed Dec 13 07:37:46 EST 2006
Author: richie
Date: Wed Dec 13 05:37:39 2006
New Revision: 9966
Log:
Pdf truncated . Fixes #2255
Modified:
vtigercrm/branches/5.0.3/include/fpdf/fpdf.php
vtigercrm/branches/5.0.3/modules/Reports/CreatePDF.php
Modified: vtigercrm/branches/5.0.3/include/fpdf/fpdf.php
==============================================================================
--- vtigercrm/branches/5.0.3/include/fpdf/fpdf.php (original)
+++ vtigercrm/branches/5.0.3/include/fpdf/fpdf.php Wed Dec 13 05:37:39 2006
@@ -122,7 +122,9 @@
if(is_string($format))
{
$format=strtolower($format);
- if($format=='a3')
+ if($format=='a1')
+ $format=array(2500,3000);
+ elseif($format=='a3')
$format=array(841.89,1190.55);
elseif($format=='a4')
$format=array(595.28,841.89);
Modified: vtigercrm/branches/5.0.3/modules/Reports/CreatePDF.php
==============================================================================
--- vtigercrm/branches/5.0.3/modules/Reports/CreatePDF.php (original)
+++ vtigercrm/branches/5.0.3/modules/Reports/CreatePDF.php Wed Dec 13 05:37:39 2006
@@ -52,6 +52,7 @@
function Html2PDF($orientation='P',$unit='mm',$format='A4')
{
+//echo '<pre>';print_r($format);echo '</pre>';
//Call parent constructor
$this->FPDF($orientation,$unit,$format);
//Initialization
@@ -295,35 +296,6 @@
$filterlist = $oReportRun->RunTimeFilter($filtercolumn,$filter,$_REQUEST["startdate"],$_REQUEST["enddate"]);
$arr_val = $oReportRun->GenerateReport("PDF",$filterlist);
-
-if(isset($arr_val))
-{
- $columnlength = count($arr_val[0]);
-}
-
-if($columnlength > 0 && $columnlength <= 4)
-{
- $pdf = new Html2PDF('P','mm','A4');
-}elseif($columnlength >= 5 && $columnlength < 8)
-{
- $pdf = new Html2PDF('L','mm','A4');
-}elseif($columnlength >= 8 && $columnlength <= 12)
-{
- $pdf = new Html2PDF('P','mm','A3');
-}elseif($columnlength > 12)
-{
- $pdf = new Html2PDF('L','mm','A3');
-}
-
-$pdf->AddPage();
-
-$pdf->SetFillColor(224,235,255);
-$pdf->SetTextColor(0);
-$pdf->SetFont('Arial','B',14);
-$pdf->Cell(($pdf->columnlength*50),10,$oReport->reportname,0,0,'C',0);
-$pdf->Ln();
-
-$pdf->SetFont('Arial','',10);
if(isset($arr_val))
{
@@ -396,6 +368,35 @@
'.$dataHTML.'
</table>';
+if(isset($arr_val))
+{
+ $columnlength = array_sum($col_width);
+}
+
+if($columnlength <= 420 )
+{
+ $pdf = new Html2PDF('P','mm','A5');
+}elseif($columnlength >= 421 && $columnlength <= 600)
+{
+ $pdf = new Html2PDF('L','mm','A4');
+}elseif($columnlength >=601 && $columnlength <= 850)
+{
+ $pdf = new Html2PDF('P','mm','A3');
+}elseif($columnlength >=851 )
+{
+ $pdf = new Html2PDF('L','mm','A1');
+}
+//echo '<pre>';print_r($columnlength);echo '</pre>';
+$pdf->AddPage();
+
+$pdf->SetFillColor(224,235,255);
+$pdf->SetTextColor(0);
+$pdf->SetFont('Arial','B',14);
+$pdf->Cell(($pdf->columnlength*50),10,$oReport->reportname,0,0,'C',0);
+$pdf->Ln();
+
+$pdf->SetFont('Arial','',10);
+
$pdf->WriteHTML($html);
$pdf->Output('Reports.pdf','D');
exit();
More information about the vtigercrm-commits
mailing list