Ver Mensaje Individual
  #1 (permalink)  
Antiguo 14/09/2011, 09:22
cacr
 
Fecha de Ingreso: agosto-2005
Ubicación: Mérida, Venezuela
Mensajes: 732
Antigüedad: 18 años, 8 meses
Puntos: 7
Zend_Pdf_Table: Fatal error: Call to undefined method Zend_Pdf_Page::addTable()

Saludos
Alguien usa Zend_Pdf_Table ? me conseguí en [0] que era sólo descargar, copiar y pegar, pero...
Lo primero es que tuve que renombrar la carpeta Zend primero para no perder la "original", cosa que a primera vista no sé sí pierdo algo...
Luego, me dió algunos errores que resolví agregando al archivo Pdf.php:
/** Zend_Pdf_Table */
require_once 'My/Pdf.php';
require_once 'My/Pdf/Document.php';
require_once 'My/Pdf/Page.php';
require_once 'My/Pdf/Table.php';
require_once 'My/Pdf/Table/Cell.php';
require_once 'My/Pdf/Table/Column.php';
require_once 'My/Pdf/Table/Row.php';
require_once 'My/Pdf/Table/HeaderRow.php';
Adivinando porque no está documentado que deba hacerse (a decir verdad que no hay ninguna documentación)
Finalmente, obtengo el siguiente error:
PHP Fatal error: Call to undefined method Zend_Pdf_Page::addTable() in
en la línea que corresponde a: $page1->addTable($table, 0, 0);

El trozo de código es:
$doc = new Zend_Pdf;
$page1 = new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_LETTER);
$doc->pages[] = $page1;
$page1->drawText("Título",20,$height-50,'UTF-8');
// create table
$table = new My_Pdf_Table(3);
for($i=0; $i<3; $i++)
{
$row = new My_Pdf_Table_Row();
$cols = array();
$col = new My_Pdf_Table_Column();

$cols[] = "reciboc10, reciboc06, reciboc08, reciboc07";
$row->setColumns($cols);
$table->addRow($row);
}
// add table to page
$page1->addTable($table, 0, 0);
sacado del mismo ejemplo en [0]

El apartado en [0] se llama "Turning The Tables".

Gracias!

[0]http://devzone.zend.com/article/12492
__________________
Gracias de todas todas
-----
Linux!