Take the 2-minute tour ×
Magento Stack Exchange is a question and answer site for users of the Magento e-Commerce platform. It's 100% free, no registration required.

How to export my custom grid data's in xls format in Magento Admin panel grid.

In default we having the csv and xml format.

enter image description here

Anyone help me on it.

share|improve this question

1 Answer 1

up vote 5 down vote accepted

Try this below code:

$this->addExportType('*/*/exportExcel', Mage::helper('{module}')->__('Excel'));
public function exportExcelAction()  
{  
    $fileName   = 'excel_name.xls';
    $content    = $this->getLayout()->createBlock('{module}/adminhtml_{module}_grid')->getExcelFile();
    $this->_prepareDownloadResponse($fileName, $content);  
}  

also refer here

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.