/** * get cell value * * @param Zend_Config $_field * @param Tinebase_Record_Interface $_record * @param string $_cellType * @return string */ protected function _getCellValue(Zend_Config $_field, Tinebase_Record_Interface $_record, &$_cellType) { switch ($_field->type) { case 'datetime': case 'date': if ($_record->{$_field->identifier} instanceof DateTime) { $result = PHPExcel_Shared_Date::PHPToExcel($_record->{$_field->identifier}->getTimestamp()); } else { $result = $_record->{$_field->identifier}; } // empty date cells, get displayed as 30.12.1899 if (empty($result)) { $result = NULL; } break; default: $result = parent::_getCellValue($_field, $_record, $_cellType); break; } return $result; }
/** * (non-PHPdoc) * @see Tinebase_Export_Abstract::_exportRecords() */ protected function _exportRecords() { parent::_exportRecords(); $sheet = $this->_excelObject->getActiveSheet(); for ($i = 0; $i < $this->_columnCount; $i++) { $sheet->getColumnDimension($i)->setAutoSize(TRUE); } }