您好,欢迎来到三六零分类信息网!老站,搜索引擎当天收录,欢迎发信息

关于PHPEXCEL输出表格有上万条记录的时候貌似挂了

2026/1/24 17:31:20发布11次查看
关于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');

该用户其它信息

VIP推荐

免费发布信息,免费发布B2B信息网站平台 - 三六零分类信息网 沪ICP备09012988号-2
企业名录 Product