使用PHPExcel操作Excel用法实例分析(3)

require_once("05featuredemo.inc.php"); require_once('Classes/PHPExcel/Writer/HTML.php'); //Write to HTML format $objWriter = new PHPExcel_Writer_HTML($objPHPExcel); $objWriter->setSheetIndex(0); $objWriter->save(str_replace('.php', '.htm', __FILE__));

6.写pdf

require_once("05featuredemo.inc.php"); require_once('Classes/PHPExcel/IOFactory.php'); //Write to PDF format $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'PDF'); $objWriter->setSheetIndex(0); $objWriter->save(str_replace('.php', '.pdf', __FILE__)); //Echo memory peak usage echo date('H:i:s')." Peak memory usage: ".(memory_get_peak_usage(true) / 1024 / 1024)." MB\r\n";

内容版权声明:除非注明,否则皆为本站原创文章。

转载注明出处:http://www.heiqu.com/74201cf98a8536eacc07821874e91566.html