When PHPEXCEL output reports contain tens of thousands of records, it seems to have crashed? This is a complete and available phpexcel example & lt ;? Phprequire ('regiondes/application_top.php '); error_reporting (E_ALL); set_include_path (get_ I seems to be suspended when there are tens of thousands of records in the PHPEXCEL output report?
This is a complete and available phpexcel example.
Require ('regiondes/application_top.php ');
Error_reporting (E_ALL );
Set_include_path (get_include_path (). PATH_SEPARATOR. 'classes/'); // you can specify the path for a route entry.
Include 'phpexcel/PHPExcel. php ';
Include 'phpexcel/PHPExcel/IOFactory. php ';
$ ObjPHPExcel = new PHPExcel ();
$ ObjPHPExcel-> getActiveSheet ()-> freezePane ('A2 ');
$ SharedStyle1 = new PHPExcel_Style ();
$ SharedStyle1-> applyFromArray (
Array ('fill' => array (
'Type' => PHPExcel_Style_Fill: FILL_SOLID,
'Color' => array ('Arg' => '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 ('Arg' => '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'); // you can specify the name of the worksheet before the worksheet.
For ($ I = 0; $ I <15; $ I ++ ){
$ ObjPHPExcel-> getActiveSheet ()-> getStyleByColumnAndRow ($ I, 1)-> getFont ()-> setBold (true); // you can specify the content in the first line as bold.
}
$ ObjPHPExcel-> getActiveSheet ()-> setCellValueByColumnAndRow (0, 1, 'first name ');
$ ObjPHPExcel-> getActiveSheet ()-> setCellValueByColumnAndRow (1, 1, 'last name ');