Cakephp 使用xlsHelper导出Excel文件

Cakephp 使用xlsHelper导出Excel文件,cakephp,Cakephp,我正在使用cakephp的xlsHelper以excel格式导出。它在除“mac”操作系统之外的所有主要浏览器和所有操作系统中都能正常工作?这对您有帮助吗 <?php $this->layout=""; $filename=strtotime("now"); header ("Expires: 0"); header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT"); header (

我正在使用cakephp的xlsHelper以excel格式导出。它在除“mac”操作系统之外的所有主要浏览器和所有操作系统中都能正常工作?这对您有帮助吗

<?php 
    $this->layout="";
    $filename=strtotime("now");
    header ("Expires: 0");
    header ("Last-Modified: " . gmdate("D,d M YH:i:s") . " GMT");
    header ("Cache-Control: no-cache, must-revalidate");
    header ("Pragma: no-cache");
    header ("Content-type: application/vnd.ms-excel");
    header ("Content-Disposition: attachment; filename=".$filename.".xls");
    header ("Content-Description: Generated Report" );

   // echo 'Number of Rows::'."\t" . count($test)."\n";
   // echo "\n";
    echo    'Id' . "\t" . 
            'EnrollmentId' . "\t" . 
            'IDS' . "\t" . 
            'sysreq' . "\t" . 
            'sysproc' . "\t" . 
            'Request' . "\t" .
            'Response' . "\t" .
            'Created' . "\n";
    foreach($test as $val): 
           echo $val['abc']['id']. "\t" .
                $val['xyz']['enrollment_id']. "\t" .
                $val['bca']['IDS']. "\t" .
                $val['mca']['_sysreq']. "\t" .
                $val['car']['_sysproc']. "\t" .
                $val['azx']['SYSBATCHNO']. "\t" .
                $val['tyu']['MSGS']. "\t" .
                $val['wer']['created']. "\n";
    endforeach;