I am using cezPDF library in CodeIgniter 2
But it seems it can't print the table or ezTable isn't working properly
Anyone faced this before? or any solution on that?
take a look at my code here:
$db_data [] = array ('name' => 'x' );
$db_data [] = array ('name' => 'y' );
$db_data [] = array ('name' => 'z' );
$col_names = array ('name' => 'col' );
$this->cezpdf->ezTable ( $db_data, $col_names, '', array ('width' => 180, 'xPos' => 140 ) );
You are forgetting to write this instruction
$this->cezpdf->ezStream();
By the way this is a working example
$this->load->library('cezpdf');
$db_data[] = array('name' => 'Jon Doe', 'phone' => '111-222-3333', 'email' => 'jdoe@someplace.com');
$db_data[] = array('name' => 'Jane Doe', 'phone' => '222-333-4444', 'email' => 'jane.doe@something.com');
$db_data[] = array('name' => 'Jon Smith', 'phone' => '333-444-5555', 'email' => 'jsmith@someplacepsecial.com');
$col_names = array(
'name' => 'Name',
'phone' => 'Phone Number',
'email' => 'E-mail Address'
);
$this->cezpdf->ezTable($table_data, $col_names, 'Contact List', array('width'=>550));
$this->cezpdf->ezStream();