Вобщем разобрался с либой по уроку http://swblog.ru/articles/programming/sozdaem-otchety-v-excel-na-php.html но когда перевел все в ооп все работает но файл кривой создается. Может что то упустил посмотрите код пж. PHP: <? ini_set('error_reporting', E_ALL); ini_set('display_errors', 1); ini_set('display_startup_errors', 1); // Подключаем класс для работы с excel require_once('Classes/PHPExcel.php'); // Подключаем класс для вывода данных в формате excel require_once('Classes/PHPExcel/Writer/Excel2007.php'); class createShitAndSave{ private $xls; private $sheet; private $cou; function __construct(){ $this->cou = 1; // Создаем объект класса PHPExcel $this->xls = new PHPExcel(); // Устанавливаем индекс активного листа $this->xls->setActiveSheetIndex(0); // Получаем активный лист $this->sheet = $this->xls ->getActiveSheet(); // Подписываем лист $this->sheet->setTitle('Заказы с сайта'); } public function addTitle($title){ // Вставляем текст в ячейку A1 $n = "A".$this->cou; $this->sheet->setCellValue($n, $title); $this->sheet->getStyle($n)->getFill()->setFillType( PHPExcel_Style_Fill::FILL_SOLID); $this->sheet->getStyle($n)->getFill()->getStartColor()->setRGB('EEEEEE'); // Выравнивание текста $this->sheet->getStyle($n)->getAlignment()->setHorizontal( PHPExcel_Style_Alignment::HORIZONTAL_CENTER); $this->cou++; $this->addData(); return $this->getFile(); } private function addData(){ for ($i = 2; $i < 10; $i++) { for ($j = 2; $j < 10; $j++) { // Выводим таблицу умножения $this->sheet->setCellValueByColumnAndRow( $i - 2, $j, $i . "x" .$j . "=" . ($i*$j)); // Применяем выравнивание $this->sheet->getStyleByColumnAndRow($i - 2, $j)->getAlignment()-> setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); } } } private function getFile(){ // Выводим HTTP-заголовки header ( "Expires: Mon, 1 Apr 1974 05:00:00 GMT" ); header ( "Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT" ); header ( "Cache-Control: no-cache, must-revalidate" ); header ( "Pragma: no-cache" ); header ( "Content-type: application/vnd.ms-excel" ); header ( "Content-Disposition: attachment; filename=test.xls" ); // Выводим содержимое файла $objWriter = new PHPExcel_Writer_Excel5($this->xls); $objWriter->save('php://output'); } } $crt = new createShitAndSave(); $crt->addTitle('Тест'); ?> в файле куча кракозябр и вот таких варнингов <b>Warning</b>: date(): It is not safe to rely on the system's timezone settings. You are *required* to use the date.timezone setting or the date_default_timezone_set() function. In case you used any of those methods and you are still getting this warning, you most likely misspelled the timezone identifier. We selected the timezone 'UTC' for now, but please set date.timezone to select your timezone. in <b>/home/cpinua/movies-revies.ru/pars/Classes/PHPExcel/Shared/OLE.php</b> on line <b>472</b><br /> понимаю что что то с датой а вот как исправить. --- Добавлено --- Все решил. Полез в файл либы и указал явно временную зону