case \thebuggenie\core\entities\CustomDatatype::USER_CHOICE:
                    $value = $value instanceof \thebuggenie\core\entities\common\Identifiable ? $value->getName() : '';
                    break;
                case \thebuggenie\core\entities\CustomDatatype::INPUT_TEXT:
                case \thebuggenie\core\entities\CustomDatatype::INPUT_TEXTAREA_MAIN:
                case \thebuggenie\core\entities\CustomDatatype::INPUT_TEXTAREA_SMALL:
                default:
                    break;
            }
            $sheet->setCellValueByColumnAndRow($start_column, $cc, $value);
            $start_column++;
        }
        $cc++;
    }
}
ob_end_clean();
switch ($format) {
    case 'xlsx':
        $objWriter = new \PHPExcel_Writer_Excel2007($phpexcel);
        header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
        header('Content-Disposition: attachment;filename="issues.xlsx"');
        break;
    case 'ods':
    default:
        header('Content-Type: application/vnd.oasis.opendocument.spreadsheet');
        header('Content-Disposition: attachment;filename="issues.ods"');
        $objWriter = new \PHPExcel_Writer_OpenDocument($phpexcel);
}
header('Cache-Control: max-age=0');
$objWriter->save('php://output');
exit;
<?php

/**
 * Created by PhpStorm.
 * User: kratbro
 * Date: 17.08.15
 * Time: 20:51
 */
$phpExcelObject = new PHPExcel();
$phpExcelObject->getProperties()->setCreator("Jan Urbansky")->setTitle("Test the excel")->setSubject("Testing")->setDescription("This is a test document for something");
$phpExcelObject->setActiveSheetIndex(0)->setCellValue('A1', 'Hello')->setCellValue('B2', 'World')->setCellValue('C1', 'Hello')->setCellValue('D2', 'World');
$phpExcelObject->getActiveSheet()->setTitle('Simple');
$objWriter = new PHPExcel_Writer_OpenDocument($phpExcelObject);
$objWriter->save("files/mydoc.ods");