$objPHPExcel = new PHPExcel();
$objPHPExcel->setActiveSheetIndex(0); $objPHPExcel->getActiveSheet()->setCellValue('A1', 'Description'); $objPHPExcel->getActiveSheet()->setCellValue('B1', 'Amount');
$objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(30); $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setWidth(12);
Dan aku gunakan cara yang aku rasa lebih mudah;
$objPHPExcel = new PHPExcel();
$sheet = $objPHPExcel->getActiveSheet(); $sheet->getColumnDimension('A')->setWidth(20); $sheet->getColumnDimension('B')->setWidth(20);
$objPHPExcel->setActiveSheetIndex(0) ->setCellValue('A1', 'Description') ->setCellValue('B1', 'Amount');
entah la.
Tiada ulasan:
Catat Ulasan