/**
  * add single body row
  *
  * @param $record
  */
 public function processRecord($record, $idx)
 {
     $row = $this->_activeTable->appendRow();
     foreach ($this->_config->columns->column as $field) {
         // get type and value for cell
         $cellType = $this->_getCellType($field->type);
         $cellValue = $this->_getCellValue($field, $record, $cellType);
         // create cell with type and value and add style
         $cell = $row->appendCell($cellValue, $cellType);
         if ($field->columnStyle) {
             $cell->setStyle((string) $field->columnStyle);
         }
         // add formula
         if ($field->formula) {
             $cell->setFormula($field->formula);
         }
     }
 }
Example #2
0
 /**
  * add body rows
  *
  * @param Tinebase_Record_RecordSet $records
  */
 public function processIteration($_records)
 {
     $this->_resolveRecords($_records);
     // add record rows
     $i = 0;
     foreach ($_records as $record) {
         $row = $this->_activeTable->appendRow();
         foreach ($this->_config->columns->column as $field) {
             //$altStyle = 'ceAlternate';
             // get type and value for cell
             $cellType = $this->_getCellType($field->type);
             $cellValue = $this->_getCellValue($field, $record, $cellType);
             // create cell with type and value and add style
             $cell = $row->appendCell($cellValue, $cellType);
             // add formula
             if ($field->formula) {
                 $cell->setFormula($field->formula);
             }
             /*
             if ($i % 2 == 1) {
                 $cell->setStyle($altStyle);
             }
             */
             //if (Tinebase_Core::isLogLevel(Zend_Log::DEBUG)) Tinebase_Core::getLogger()->debug(__METHOD__ . '::' . __LINE__ . ' ' . print_r($field->toArray(), true));
         }
         $i++;
     }
 }
 /**
  * add new table and return reference
  *
  * @param string|optional $_tableName
  * @return OpenDocument_SpreadSheet_Table
  */
 public function appendTable($_tableName, $_styleName = null)
 {
     $table = OpenDocument_SpreadSheet_Table::createTable($this->_spreadSheet, $_tableName, $_styleName = null);
     return $table;
 }