It seems that the PHPEXCEL output table has tens of thousands of records.

Source: Internet
Author: User
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 ');

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.