problem with PHPExcel

Hi all

i have a problem using phpexcel with yii. i had a standalone php file that worked fine. when i ported code to yii controller and fixed issue with autoloader a got excel file to be sent, but it looks something strange.

i send file with this code




    header('Content-Type: application/vnd.ms-excel');

    header('Content-Disposition: attachment;filename="stats.xls"');

    header('Cache-Control: max-age=0');


    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');

    $objWriter->save('php://output');



i think it has wrong encoding… can anyone help me?

thanks!

i got the reason. there are 3 symbols in the beginnig of the file. how can i clear output buffer?




    ob_end_clean();

    ob_start();

    

    header('Content-Type: application/vnd.ms-excel');

    header('Content-Disposition: attachment;filename="stats.xls"');

    header('Cache-Control: max-age=0');

    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');

    $objWriter->save('php://output');



that works fine. figured all by myself)))

You are talking to yourself! :)