Masukkan key Enter ke dalam field Excel guna PHPExcel. Gunakan str_replace(). Replace coma kepada \n
<?php $objPHPExcel->getActiveSheet()->SetCellValue('O'.$bil, strtoupper(str_replace(',',"\n",c($row['kriteria'])))); setCenterOnEmpty($row['kriteria'], 'O'.$bil, $objPHPExcel); if(!function_exists("setCenterOnEmpty")){ function setCenterOnEmpty($data, $index, $objPHPExcel){ if($data==' - ' || $data=='-' || $data=='')$objPHPExcel->getActiveSheet()->getStyle($index)->getAlignment()->setHorizontal(PHPExcel_Style_Alignment::HORIZONTAL_CENTER); }} ?>
0 comments:
Post a Comment