Phpexcel 多sheet ,设置

多sheet 一定要县创建sheet 

 1  foreach ($alias_name as $ca) {
 2             if ($sheet > 0) {
 3                 $objExcel->createSheet();  // 创建sheet
 4             }
 5             $objExcel->setActiveSheetIndex($sheet);
 6             $objExcel->getActiveSheet()->setTitle($result['alias_name'][$ca]);
 7             $objActSheet = $objExcel->getActiveSheet();
 8             $objActSheet->getDefaultRowDimension()->setRowHeight(30);
 9             $sheet++;
10 }

 

posted @ 2016-07-04 09:23  北极星α  阅读(2378)  评论(0编辑  收藏  举报