How to Export to Excel .xls and Change File Name

Export to Excel .xls and Change File Name for PHP

How to Export Excel .xls
From grid-excel-php.zip

  1. File : gridExcelGenerator.php
    In Row 24 : public $outputType = ‘Excel2007’
    You have to change from ‘Excel2007’ to ‘Excel2003’ and then Try!.
  2. File : gridExcelWrapper.php
    In Row 203 : public function outXLS($title, $type = ‘Excel2007’)
    You have to change from ‘Excel2007’ to ‘Excel2003’.

But for me only “1.” works really fine.

How to Change File Name
From grid-excel-php.zip

  1. File : gridExcelWrapper.php
    In Row 203 : public function outXLS($title, $type = ‘Excel2007’){}
    In switch case you will see " header('Content-Disposition: attachment; :smiley: filename=“report.xls” :smiley: ');"
    and then change filename here.

Thanks!
grid-excel-php.zip (773 KB)

Hi,

Only I will work any way because method outXLS is called always with 2 parameters:

$this->wrapper->outXLS($this->title, $this->outputType);