0
votes

I have made a custom module to export orders from magento with a custom SQL query. The whole module works great, however i want change the delimiter set on the csv export. After some searching i found out that setting a delimiter can be done in the Grid.php file in the construct. But this doesnt seem to work. This is how i have set it up.

public function __construct()
{
    parent::__construct();
    $this->setId('exportorders_'.date('d_m_Y_h_i'));
    $this->setDelimiter('|');
    $this->setDefaultDir('DESC');
    $this->setSaveParametersInSession(true);
    $this->setUseAjax(true);
}

Is there some alternative way of setting a delimiter for the csv export? I just want to set the delimiter for my custom module only.

I appreciate any help or advice.

1

1 Answers

0
votes

There should be a method streamWriteCsv called several times in your grid class (or in one of the parents - I think it should be a Mage_Adminhtml_Block_Widget_Grid).

You can pass your custom delimiter to all the method calls as a second parameter (enclosure is 3rd).