Beispiel #1
0
 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>";
     }
 }