/**
* @inheritdoc
*/
public function createExportObject(Datagrid $datagrid)
{
$this->phpExcel = $this->factory->createPHPExcelObject();
$this->phpExcel->setActiveSheetIndex(0);
$this->phpExcel->getActiveSheet()->setTitle('Datagrid export');
// Set the column headers
$c = 'A';
foreach ($columns = $datagrid->getColumns() as $column) {
$this->phpExcel->getActiveSheet()->setCellValue($c . '1', $column->getLabel());
$c++;
}
return $this->phpExcel;
}