/* Create a container object and put in the three objects created above and some empty space between them */ $content = new jh_pdf_container_jhpci(&$pdf); $content->addobject($day); $content->addemptyspace(3); $content->addobject($barcode); $content->addemptyspace(3); $content->addobject($bctext); /* Make an instance of the table class */ $table = new jh_pdf_table(&$pdf, &$ypos, 30, 565, 30); /* Set a function that will be called if a new page is necessary */ $table->setnewpagefunction(newpage); /* Define the columns; note that all the columns have "*" as their width which means that the whole table width will be divided up and assigned equally to the columns */ $col1 =& $table->addcolumn("", "*", false, $content); $col2 =& $table->addcolumn("", "*", false, $content); $col3 =& $table->addcolumn("", "*", false, $content); $col4 =& $table->addcolumn("", "*", false, $content); /* Adjust some table parameters */ $table->settopborderwidth(0); $table->setbottomborderwidth(0); $table->setcolspacingwidth(50); $table->setcolspacingcolor(false); $table->setrowspacingwidth(10); $table->setrowspacingcolor(false); $table->setbgcolors(array(false)); /* Fill up the table cell by cell from the left to the right by calling the addcell() method The table is entirely made up out of containers, so that each
function pageheader() { if ($this->title != '') { // Table for titles switch ($this->orientation) { case LANDSCAPE: $atable = new jh_pdf_table(&$this->pdf, &$this->ypos, $this->subx, 812, 30); break; case PORTRAIT: $atable = new jh_pdf_table(&$this->pdf, &$this->ypos, $this->subx, 565, 30); break; } //****************************************************** $fecha = date("d/m/Y h:m:s"); $colh = new jh_pdf_text_jhpci(&$this->pdf); $colh->setfontsize(26); $colr = new jh_pdf_text_jhpci(&$this->pdf); $colr->setfontsize($this->pdffontsize); $tcol =& $atable->addcolumn($this->title, '*', $colh, $colr); $colh = new jh_pdf_text_jhpci(&$this->pdf); $colh->setalignment("right"); $colh->setfontsize($this->pdffontsize); $colr = new jh_pdf_text_jhpci(&$this->pdf); $colr->setfontsize($this->pdffontsize); $dcol =& $atable->addcolumn($fecha . "", '*', $colh, $colr); $this->phpgrid->getlookupquery(); $what = $this->phpgrid->statustext; if ($what == '') { $what = 'Mostrando todos los registros'; } $data = array($what); $atable->addrow($data); $atable->endtable(); } }
and make the content right-aligned */ $col2r->setfontface("Courier"); $col2r->setalignment("right"); $col2h->setalignment("right"); $col3r->setfontface("Courier"); $col3r->setalignment("right"); $col3h->setalignment("right"); /* Make an instance of the table class */ $table = new jh_pdf_table(&$pdf, &$ypos, 30, 812, 30); /* Set a function that will be called if a new page is necessary */ $table->setnewpagefunction(newpage); /* Define the columns; the first column has "*" as its width which tells the class to use the remaining width for this column; the addcolumn() method returns a handle so you can adjust the column's parameters */ $col1 =& $table->addcolumn("License", "*", &$col1h, &$col1r); $col2 =& $table->addcolumn("Branches", 100, &$col2h, &$col2r); $col3 =& $table->addcolumn("Percentage", 100, &$col3h, &$col3r); $col4 =& $table->addcolumn("Barcode", 100, &$col4h, &$col4r); /* Adjust some table parameters */ $table->setverttableborderwidth(1); $table->setverttablebordercolor(0); $table->setcolspacingwidth(1); $table->setcolspacingcolor(0); $table->setrowspacingwidth(1); $table->setrowspacingcolor(0); $table->setheaderbgcolor(0.85); $table->setbgcolors(array(false, 0.95)); /* Adjust the bgcolor of the barcode cell to to white, because some barcode readers might get into trouble otherweise */ $col4->normcellparam->bgcolor = 1;