PHPExcel 1.7.9,2013-06-02的问题

时间:2014-12-08 08:53:37

标签: php codeigniter phpexcel

以非统一格式使用 PHPExcel 库获取Excel, 参考图像

enter image description here

我的代码是:

$this->load->library('excel');
$sheet = new PHPExcel();
$objWorkSheet = $sheet->createSheet();
$sheet->getProperties()->setTitle('Report')->setDescription('Report');
$sheet->setActiveSheetIndex(0);

$sheet->getActiveSheet()->setCellValue('A1','Career Stage');

$sheet_writer = PHPExcel_IOFactory::createWriter($sheet, 'Excel5');
header('Content-Type: application/vnd.ms-excel');
header('Content-Disposition: attachment;filename="pathways_'.date('dMy').'.xls"');
header('Cache-Control: max-age=0');
$sheet_writer->save('php://output');

0 个答案:

没有答案