1
我已经编写了Mozilla Firefox中工作的代码,但无法在Internet Explorer中工作 我无法解决它。在互联网浏览器中它的完整页面调整与弹出下载。 我需要与IE支持generete excel文件also.please帮助我。如何使用phpexcel库在Internet Explorer浏览器中下载excel文件
这是我的代码。
$objPHPExcel = new PHPExcel(); $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(20); $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(18); $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A1', 'Agent Code') ->setCellValue('B1', 'Month'); $i=2; while($row1=mysql_fetch_array($rs)) { $month = $row1['smonth']+1; $month_name = date('F', mktime(0, 0, 0, $month)); $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A'.$i, $row1['scode']) ->setCellValue('B'.$i, $month_name) ->setCellValue('C'.$i, $row1['syear']); $i++; } $objPHPExcel->getActiveSheet()->setTitle('Simple'); $objPHPExcel->setActiveSheetIndex(0); header('Content-Type: application/vnd.ms-excel'); header('Content-Disposition: attachment;filename="01simple.xls"'); header('Cache-Control: max-age=0'); $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5'); $objWriter->save('php://output'); exit;
沟'缓存Control',添加一个'内容Length'?一些IE版本在处理文件下载时反应不佳,他们被告知不允许被缓存。 – Charles 2011-05-14 05:18:03
这是通过SSL连接? – 2011-05-14 07:29:23