function renderHeaderBand($bandparams) { if (array_key_exists('grid', $bandparams)) { $grid = $bandparams['grid']; } else { $grid = $this->phpgrid; } $headerstyle = 'reportheader'; if ($this->issubreport) { $headerstyle = 'subreportheader'; } $grid->getlookupquery(); $what = $grid->statustext; if ($this->outputformat == HTML) { if ($what != '') { $cs = count($grid->printable); echo "<tr><td colspan=\"{$cs}\"><b>{$what}</b></td></tr>\n"; } echo "<tr class=\"{$headerstyle}\">"; } reset($grid->printable); while (list($k, $v) = each($grid->printable)) { $column = $grid->getLabel($k); if ($this->outputformat == HTML) { echo "<td>{$column}</td>"; } if ($this->outputformat == PDF) { $column = strip_tags($column); $colh = new jh_pdf_text_jhpci(&$this->pdf); if (array_key_exists($k, $this->coltypes)) { $colr = new jh_pdf_container_jhpci(&$this->pdf); $barcode = new jh_pdf_barcode_jhpci(&$this->pdf); $barcode->settype('128a'); /* Adjust the height of the barcode */ $barcode->setheight(20); $bctext = new jh_pdf_text_jhpci(&$this->pdf); $bctext->setalignment("center"); $colr->addobject($barcode); $colr->addemptyspace(3); $bctext->setfontsize($this->pdffontsize); $colr->addobject($bctext); } else { $colr = new jh_pdf_text_jhpci(&$this->pdf); $colr->setfontsize($this->pdffontsize); } $colh->setfontsize($this->pdffontsize); $colh->setfontcolor(1); if (array_key_exists($k, $this->pdfwidths)) { $w = $this->pdfwidths[$k]; } else { $w = '*'; } $col =& $this->table->addcolumn($column, $w, $colh, $colr); } } if ($this->outputformat == HTML) { echo "</tr>"; } }
/* Output the current part of the in-memory created PDF document */ print PDF_get_buffer($pdf); } /* Create a DIN A4 page */ PDF_begin_page($pdf, 595, 842); return 812; } /* Create the first page */ $ypos = newpage(false); /* Create a text object which will contain the weekday name */ $day = new jh_pdf_text_jhpci(&$pdf); $day->setalignment("center"); /* Create a barcode object which will contain some number */ $barcode = new jh_pdf_barcode_jhpci(&$pdf); $barcode->settype('25i'); $barcode->setheight(20); /* Create a text object which will contain the same number as the barcode, but this time as plain text */ $bctext = new jh_pdf_text_jhpci(&$pdf); $bctext->setalignment("center"); /* 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 */