[symfony-users] Re: Output an excel file from an action

2007-09-09 Thread Dan Grossman
I assume you need to call some method of $objWriter, like the line you commented out, for it to actually output the file. Right now your action has no output, you're sending nothing but the headers back. nico_bl1nd wrote: Hi Anakreon, I'm facing a similar problem. I've made a simple export

[symfony-users] Re: Output an excel file from an action

2007-09-09 Thread nico_bl1nd
In fact, it was a mistake in the code I've shown. When comment out this line, it doesn't work either. I've tried to write the file directly to disk, and it works $objWriter-save(/test.xls); But sending the file for download doesn't work. --~--~-~--~~~---~--~~

[symfony-users] Re: Output an excel file from an action

2007-09-09 Thread nico_bl1nd
Hi Kupo, thanks for your message, So, after some tests: there is an error with $this-getResponse()-setHeader, it can't find the setHeader method. for testing I've set the headers manually : header('Content-Type: ' . 'application/vnd.ms-excel'); header('Content-Disposition: attachment;

[symfony-users] Re: Output an excel file from an action

2007-09-09 Thread Kiril Angov
$this-getResponse()-setHttpHeader($name, $value, $replace = true) http://start.gotapi.com Sorry I did not verify before sending. for the errors you can use $error_reporting = error_reporting(0); ob_start() $xml_source = ... ob_clean(); error_reporting($error_reporting); Kupo nico_bl1nd

[symfony-users] Re: Output an excel file from an action

2007-09-09 Thread nico_bl1nd
thanks for your help, it works fine. finally my code looks like this : public function executeExport() { /** PHPExcel */ include 'PHPExcel.php'; /** PHPExcel_Writer_Excel5 */ include 'PHPExcel/Writer/Excel5.php'; // Create new PHPExcel object $objPHPExcel = new

[symfony-users] Re: Output an excel file from an action

2007-09-09 Thread Kiril Angov
Nico, you have to remember that $this-renderText($text) does not return any data but rather sfView::NONE I think you should fix your code for clarity (although it works now) // Save Excel 5 file $error_reporting = error_reporting(0); $objWriter = new PHPExcel_Writer_Excel5($objPHPExcel);

[symfony-users] Re: Output an excel file from an action

2007-09-09 Thread nico_bl1nd
Thanks Kupo, everything works fine right now. thanks again for your help. Nicolas Binet --~--~-~--~~~---~--~~ You received this message because you are subscribed to the Google Groups symfony users group. To post to this group, send email to

[symfony-users] Re: Output an excel file from an action

2007-09-08 Thread nico_bl1nd
Hi Anakreon, I'm facing a similar problem. I've made a simple export action and added the demo code from PHP Excel, everything seems ok, the file is sent to my computer, but it's completely empty. Could you paste your PHPExcel code here ? I don't know how to save the Excel. mine is the

[symfony-users] Re: Output an excel file from an action

2007-09-05 Thread Tristan Rivoallan
On 9/5/07, anakreon [EMAIL PROTECTED] wrote: (output started at /home/anakreon/ekby_site/lib/PHPExcel/Shared/OLE/ OLE_Root.php:254) what do you see at this line in the file ? it's probably just a whitespace problem : cleanup PHPExcel or make use of output buffering. Also, the page ends

[symfony-users] Re: Output an excel file from an action

2007-09-05 Thread anakreon
On Sep 5, 2:59 pm, Tristan Rivoallan [EMAIL PROTECTED] wrote: On 9/5/07, anakreon [EMAIL PROTECTED] wrote: (output started at /home/anakreon/ekby_site/lib/PHPExcel/Shared/OLE/ OLE_Root.php:254) what do you see at this line in the file ? It ends the command which makes the first attempt