Change this:
- Code: Select all
$this->Editor->data['sessionData'] = $_GET['session_data'];
$this->Editor->setDefaults();
ob_end_clean();
header('Cache-Control: no-cache, must-revalidate');
header('Pragma: no-cache');
header('Content-type: application/x-msexcel');
header('Content-Type: text/csv');
header('Content-Disposition: attachment; filename="'.$this->Editor->tableName.'.csv"');
// Add utf-8 signature for windows/excel
echo chr(0xEF).chr(0xBB).chr(0xBF);
echo $this->Editor->exportInfo();
exit();
To This:
- Code: Select all
$this->Editor->data['sessionData'] = $_GET['session_data'];
$this->Editor->setDefaults();
ob_end_clean();
//header('Cache-Control: no-cache, must-revalidate');
//header('Pragma: no-cache');
//header('Content-type: application/x-msexcel');
//header('Content-Type: text/csv');
//header('Content-Disposition: attachment; filename="'.$this->Editor->tableName.'.csv"');
include('export.php');
echo $this->Editor->exportInfo();
exit();
I put the actual export config in a separate file so that I only need to modify once rather than on every page. So this is what is in the export.php.
- Code: Select all
<?php
//header("Cache-Control: no-cache, must-revalidate");
//header("Pragma: no-cache");
//header("Content-type: application/x-msexcel");
header("Pragma: ");
header("Cache-Control: ");
header("Content-type: application/vnd.ms-excel; name='excel'");
//header('Content-disposition: attachment; filename="'.$this->Editor->tableName.'.csv"');
header('Content-disposition: filename="'.$this->Editor->tableName.'.csv"');
//Add utf-8 signature for windows/excel
echo chr(0xEF).chr(0xBB).chr(0xBF);
?>