X-Git-Url: https://git.llucax.com/mecon/meconlib.git/blobdiff_plain/8f02488239ef8055330bf3952e8ef8b32b325fda..f82ac09838f49891a683ca0cf345adf06b5e75f9:/lib/MECON/PDF/Tabla.php diff --git a/lib/MECON/PDF/Tabla.php b/lib/MECON/PDF/Tabla.php index db39cd7..37ecb7d 100644 --- a/lib/MECON/PDF/Tabla.php +++ b/lib/MECON/PDF/Tabla.php @@ -39,26 +39,16 @@ class MECON_PDF_Tabla extends MECON_PDF_Marco { * @access public */ function display() { - if ($this->getRowCount()) { - $this->_agregarContenido(); - - //Agrego los encabezados - $t = true; - foreach ($this->_pdf->getPages() as $page) { - $this->_pdf->_pagina_actual = $page; - $this->buildPage($t, $t); - $t = false; - } - //}}} - } - else { - $this->_pdf->newPage($this->_tamanio); - $this->_pdf->addText($this->_config['Xi'], - $this->_config['contenido']['Y'], - 'No hay contenido para mostrar.', - $this->_config['contenido']); - $this->buildPage(); + $this->_agregarContenido(); + + //Agrego los encabezados + $t = true; + foreach ($this->_pdf->getPages() as $page) { + $this->_pdf->_pagina_actual = $page; + $this->buildPage($t, $t); + $t = false; } + $this->_pdf->display(); } @@ -122,8 +112,7 @@ class MECON_PDF_Tabla extends MECON_PDF_Marco { * @access protected */ function _obtenerAnchoColumnas() { - $ancho_pagina = abs($this->_config['Xf'] - - $this->_config['Xi']) ; + $ancho_pagina = $this->_pdf->getWidth($this->_orientacion); for ($i=0; $i<$this->getColCount(); $i++ ) { $tmp = $this->getCellAttributes(0,$i); if (is_null(@$tmp['width'])) { @@ -132,12 +121,12 @@ class MECON_PDF_Tabla extends MECON_PDF_Marco { $attr[$i] = intval($tmp['width']); } $tmp = array_sum($attr); - $attr2[0] = $this->_config['Xi']; + $attr2[0] = 0; for ($i=1; $i_config['Xf']; + $attr2[$i] = $ancho_pagina; return $attr2; } @@ -168,7 +157,7 @@ class MECON_PDF_Tabla extends MECON_PDF_Marco { } } - if ($alto < $this->_config['Yi']) { + if ($alto < 0) { $this->_pdf->newPage($this->_tamanio); $alto = $this->_getAvailableSpace($this->_pdf->numPage()); @@ -176,9 +165,9 @@ class MECON_PDF_Tabla extends MECON_PDF_Marco { $alto -= $repetir[$ii]['max']; for ($jj = 0; $jj < $this->getColCount(); $jj++) { $estilo = $this->_obtenerEstiloCelda($ii, $jj); - $this->_pdf->addRectangle($alto, $attr2[$jj], - $alto+$repetir[$ii]['max'], - $attr2[$jj+1], @$estilo['fill']); + $this->_pdf->addRectangle($attr2[$jj], $alto, + $attr2[$jj+1], $alto+$repetir[$ii]['max'], + @$estilo['fill'], null, $this->_orientacion); $alto1 = $alto + $repetir[$ii]['max']; foreach ($repetir[$ii][$jj] as $t) { @@ -189,7 +178,7 @@ class MECON_PDF_Tabla extends MECON_PDF_Marco { $estilo); $this->_pdf->addText($init, $alto1 + 2, - $t, $estilo); + $t, $estilo, null, $this->_orientacion); } } } @@ -201,9 +190,9 @@ class MECON_PDF_Tabla extends MECON_PDF_Marco { $estilo = $this->_obtenerEstiloCelda($i, $j); - $this->_pdf->addRectangle($alto, $attr2[$j], - $alto+$max, - $attr2[$j+1], @$estilo['fill']); + $this->_pdf->addRectangle($attr2[$j], $alto, + $attr2[$j+1], $alto+$max, @$estilo['fill'], null, + $this->_orientacion); $alto1 = $alto + $max; foreach ($txtt[$j] as $t) { @@ -214,7 +203,7 @@ class MECON_PDF_Tabla extends MECON_PDF_Marco { $estilo); $this->_pdf->addText($init, $alto1 + 2, - $t, $estilo); + $t, $estilo, null, $this->_orientacion); } } }