Magento Forum

   
Sales Report CSV download
 
da.v.id
Jr. Member
 
Total Posts:  9
Joined:  2008-09-30
 

When I try to download the sales report as a .CSV file, I get the message “Cannot send headers; headers already sent”, followed by other error messages. I was wondering if I’m the only one with this problem, or do others have it too

 
Magento Community Magento Community
Magento Community
Magento Community
 
radders
Sr. Member
 
Total Posts:  162
Joined:  2008-03-23
 

Yes I get this too:

Cannot send headersheaders already sent in C:\xampp\htdocs\magento\app\code\core\Mage\Reports\Model\Totals.phpline 2

#0 C:\xampp\htdocs\magento\lib\Zend\Controller\Response\Abstract.php(114): Zend_Controller_Response_Abstract->canSendHeaders(true)
#1 C:\xampp\htdocs\magento\app\code\core\Mage\Adminhtml\Controller\Action.php(284): Zend_Controller_Response_Abstract->setHeader('Pragma', 'public', true)
#2 C:\xampp\htdocs\magento\app\code\core\Mage\Adminhtml\controllers\Report\SalesController.php(62): Mage_Adminhtml_Controller_Action->_prepareDownloadResponse('sales.csv', '"Period","Numbe...')
#3 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Action.php(349): Mage_Adminhtml_Report_SalesController->exportSalesCsvAction()
#4 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Router\Admin.php(143): Mage_Core_Controller_Varien_Action->dispatch('exportSalesCsv')
#5 C:\xampp\htdocs\magento\app\code\core\Mage\Core\Controller\Varien\Front.php(174): Mage_Core_Controller_Varien_Router_Admin->match(Object(Mage_Core_Controller_Request_Http))
#6 C:\xampp\htdocs\magento\app\Mage.php(447): Mage_Core_Controller_Varien_Front->dispatch()
#7 C:\xampp\htdocs\magento\index.php(46): Mage::run()
#8 {main}

I was hoping that the exported version might have some information on it because the one on the screen just has the totals for the period and no information about the individual orders.

 
Magento Community Magento Community
Magento Community
Magento Community
 
jklina
Sr. Member
 
Avatar
Total Posts:  82
Joined:  2008-06-12
Philadelphia PA
 

I’m glad I stumbled onto this post. I was going to say that I get the same message when I try to export a bestsellers report.

 
Magento Community Magento Community
Magento Community
Magento Community
 
malken00
Jr. Member
 
Total Posts:  17
Joined:  2008-07-30
 

Open app/code/core/Mage/Reports/Model/Totals.php and remove the space at the beginning of the file so that

<?php

is on the first line.

 
Magento Community Magento Community
Magento Community
Magento Community
 
RoryD
Jr. Member
 
Total Posts:  3
Joined:  2008-04-10
 

excellent. thanks

 
Magento Community Magento Community
Magento Community
Magento Community
 
dlw
Jr. Member
 
Total Posts:  27
Joined:  2007-09-02
 

Thank you, I thought this was going to drive me mental.

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
    Back to top