How to export formula functions in PHPExcel php when using phpexcel to export excel, the cell content is basically written function formulas. this is very slow and slow! Have you ever encountered such a problem? how can this problem be solved?
Reply to discussion (solution)
For example
$objPHPExcel->setActiveSheetIndex(1)->insertNewRowBefore($count,1); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('A'.$count, $value['partnum']); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('B'.$count, $value['wafer']); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('C'.$count, $value['package']); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('D'.$count, $value['bpandsum']); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('E'.$count, "=MAX('forecast data'".'!$R$'.($count+1).",'forecast data'".'!$S$'.($count+1).')'); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('F'.$count, "=Sheet1!E".$count."+'forecast data'!D".($count+1)."+'forecast data'!E".($count+1)); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('G'.$count, "=E".$count."+SUM('forecast data'!D".($count+1).":G".($count+1).")"); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('H'.$count, "=E$count+SUM('forecast data'!D".($count+1).":I".($count+1).")"); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('I'.$count, "=E$count+SUM('forecast data'!D".($count+1).":K".($count+1).")"); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('J'.$count, "=ROUNDUP((MAX(0,E$count-'forecast data'!M".($count+1)."-'forecast data'!N".($count+1)."-'forecast data'!U".($count+1).")*'forecast data'!P".($count+1).")/0.9/('forecast data'!AF".($count+1)."/1000),0)"); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('K'.$count, "=ROUNDUP((MAX(0,F$count-'forecast data'!M".($count+1)."-'forecast data'!N".($count+1)."-'forecast data'!U".($count+1).")*'forecast data'!P".($count+1).")/0.9/('forecast data'!AF".($count+1)."/1000),0)"); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('L'.$count, "=ROUNDUP((MAX(0,G$count-'forecast data'!M".($count+1)."-'forecast data'!N".($count+1)."-'forecast data'!U".($count+1).")*'forecast data'!P".($count+1).")/0.9/('forecast data'!AF".($count+1)."/1000),0)"); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('M'.$count, "=ROUNDUP((MAX(0,H$count-'forecast data'!M".($count+1)."-'forecast data'!N".($count+1)."-'forecast data'!U".($count+1).")*'forecast data'!P".($count+1).")/0.9/('forecast data'!AF".($count+1)."/1000),0)"); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('N'.$count, "=ROUNDUP((MAX(0,I$count-'forecast data'!M".($count+1)."-'forecast data'!N".($count+1)."-'forecast data'!U".($count+1).")*'forecast data'!P".($count+1).")/0.9/('forecast data'!AF".($count+1)."/1000),0)"); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('O'.$count, "=ROUNDUP(SUM('forecast data'!D".($count+1).":E".($count+1).")/0.9/('forecast data'!AF".($count+1)."/1000),0)"); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('P'.$count, "=ROUNDUP(SUM('forecast data'!F".($count+1).":G".($count+1).")/0.9/('forecast data'!AF".($count+1)."/1000),0)"); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('Q'.$count, "=ROUNDUP(SUM('forecast data'!H".($count+1).":I".($count+1).")/0.9/('forecast data'!AF".($count+1)."/1000),0)"); $objPHPExcel->setActiveSheetIndex(1)->setCellValue('R'.$count, "=ROUNDUP(SUM('forecast data'!J".($count+1).":K".($count+1).")/0.9/('forecast data'!AF".($count+1)."/1000),0)");
The code I posted above loops 400 items
You can't figure it out and click it directly.