使用PHPexcel导出数据但出现错误

时间:2019-07-11 01:44:54

标签: codeigniter-3

发生错误的代码:

这是我的控制者:

require (APPPATH.'libraries/PHPExcel.php');
        require (APPPATH.'libraries/PHPExcel/Writer/Excel2007.php');


header("Last-Modified: " . gmdate("D, d M Y H:i:s") . " GMT");
            header("Cache-Control: no-store, no-cache, must-revalidate");
            header("Cache-Control: post-check=0, pre-check=0", false);
            header("Pragma: no-cache");
            header('Content-Type: application/vnd.openxmlformats-officedocument.spreadsheetml.sheet');
            //Nama File
            header('Content-Disposition: attachment;filename="report.xlsx"');
            //Download
            $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel2007');
            $objWriter->save("php://output");
        }
    }

这是我的错误:

Fatal error: Cannot redeclare class PHPExcel in C:\xampp\htdocs\e-sabusemusim\application\libraries\PHPExcel.php on line 35

0 个答案:

没有答案