/** * Adiciona uma celula * * @param ZendT_Report_Cell $_cell * @return ZendT_Report_Abstract */ public function addCell(ZendT_Report_Cell $_cell) { $this->_cells[] = $_cell; if (substr($_cell->getName(), 0, 6) == 'title_') { $this->_tableWidth += $_cell->getWidth(); } return $this; }
/** * Adiciona uma celula * * @param ZendT_Report_Cell $_cell * @return ZendT_Report_Abstract */ public function addCell(ZendT_Report_Cell $_cell) { $value = $_cell->getValue(); if ($value instanceof ZendT_Type_FileSystem) { /* $pagecount = $this->_driver->setSourceFile($value->getFile()->getFilename()); for ($page = 1; $page <= $pagecount; $page++) { $this->_driver->AddPage(); $tplidx = $this->_driver->importPage($page); $s = $this->_driver->getTemplatesize($tplidx); $this->_driver->useTemplate($tplidx, 0.5, 0.5, $s['w'], $s['h']); } */ $value = utf8_decode($value->get()); } else { if ($value instanceof ZendT_Type) { $value = utf8_decode($value->get()); } else { $value = utf8_decode($value); } } $this->_driver->SetFont($_cell->getFontName(), $_cell->getStyle(), $_cell->getFontSize()); if (strtoupper($value) == $value) { $width = $this->_driver->GetStringWidth('Z'); } else { $width = $this->_driver->GetStringWidth('z'); } if ($_cell->getWidth()) { $space = $_cell->getWidth(); } else { $space = $this->_pageWidth / $this->_maxPerLine; } $numCaracter = round($this->_pxToCm($space) / $width); $arrayValues = array(); $this->_wordWrap($value, $numCaracter, $arrayValues); if (count($arrayValues) > $this->_cells['maxLine']) { $this->_cells['maxLine'] = count($arrayValues); } $this->_cells['values'][] = $arrayValues; $this->_cells['cell'][] = $_cell; return $this; }