关于phpexcel输出报表有上万条记录的时候貌似挂了?
这是一个完整可用的phpexcel例子
getactivesheet()->freezepane('a2');
$sharedstyle1 = new phpexcel_style();
$sharedstyle1->applyfromarray(
array('fill' => array(
'type' => phpexcel_style_fill::fill_solid,
'color' => array('argb' => 'ffccffcc')
),
'borders' => array(
'bottom'=> array('style' => phpexcel_style_border::border_thin),
'right' => array('style' => phpexcel_style_border::border_medium)
)
));
$sharedstyle2 = new phpexcel_style();
$sharedstyle2->applyfromarray(
array('fill' => array(
'type' => phpexcel_style_fill::fill_solid,
'color' => array('argb' => 'fff4f4f4')
)
));
$objphpexcel->getactivesheet()->setsharedstyle($sharedstyle1, a1:o1);
$objphpexcel->getactivesheet()->getcolumndimension('a')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('b')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('c')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('d')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('e')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('f')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('g')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('h')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('i')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('j')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('k')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('l')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('m')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('n')->setwidth(50);
$objphpexcel->getactivesheet()->getcolumndimension('o')->setwidth(50);
$objphpexcel->getactivesheet()->settitle('student export');//設置當前工作表的名稱
for($i=0;$i $objphpexcel->getactivesheet()->getstylebycolumnandrow($i, 1)->getfont()->setbold(true);//設置第一行內容加粗
}
$objphpexcel->getactivesheet()->setcellvaluebycolumnandrow(0, 1,'first name');
$objphpexcel->getactivesheet()->setcellvaluebycolumnandrow(1, 1,'last name');