Hello,

First of all thank you for this module.

I think we could add some flexibility providing an alter hook where users can modify/extend the generic PHPExcel file. IE Adding a specific cell formatting for a column.

Patch attached adds anew hook hook_views_data_export_phpexcel_alter() where users can do all these things.

Regards.

Comments

eugis’s picture

Great patch!
But I'm wondering, is it a good pattern to have drupal_alter() inside a theme function? It's like a step back from theme layer to module layer...

eugis’s picture

So here's my approach to this issue. Usage example:

function mymodule_preprocess_views_data_export_xlsx_body(&$vars) {
    /** @var PHPExcel $objPHPExcel */
    $objPHPExcel = $vars['objPHPExcel'];
    $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setAutoSize(true);
}