示例#1
0
文件: Xls.php 项目: rtsantos/mais
 /**
  * Adiciona uma nova celula a tabela
  * @param ZendT_Report_Cell $cell
  * @return \ZendT_Report_Xls 
  */
 public function addCell(ZendT_Report_Cell $cell)
 {
     if ($this->_rows < 1) {
         if ($cell->getType() == '') {
             $cell->setType('Title');
         }
     }
     $cell->setTaStyle($this->_checkStyle($cell));
     $this->_cells[] = $cell;
     if (count($this->_cells) > $this->_numColumns) {
         $this->_numColumns = count($this->_cells);
         $this->_columns = '';
         foreach ($this->_cells as $key => $cell) {
             $this->_columns .= '<Column ss:AutoFitWidth="0" ss:Width="';
             if ($cell->getWidth() > 0) {
                 if ($key == 0 && $cell->getWidth() < 170) {
                     $this->_columns .= '170';
                 } else {
                     $this->_columns .= $cell->getWidth();
                 }
             } else {
                 $this->_columns .= '170';
             }
             $this->_columns .= '"';
             if ($cell->getColspan() > 0) {
                 $this->_columns .= ' ss:MergeAcross="' . $cell->getColspan() . '"';
             }
             $this->_columns .= '/>' . "\n";
         }
     }
     return $this;
 }