Questions about phpexcel

Source: Internet
Author: User
You can run phpexcel locally. It is okay to export the excel file, but it does not respond after it is deployed on the server. I have logged out on the Internet like // require_once & nbsp; PHPEXCEL_ROOT & nbsp ;. & nbsp; 'phpexcel/Shared/ZipStreamWrapper. php '; does not work either. The following is the export code. For more information, see phpexcel.
Run locally. It is okay to export the excel file, but it does not respond when it is deployed on the server. I have logged out the file on the internet and read it like // require_once PHPEXCEL_ROOT. 'phpexcel/Shared/ZipStreamWrapper. php '; does not work either. The following is the export code. thank you for your comments:

// Export data in excel
Function excel (){
Require_once './Classes/PHPExcel. php ';
Require_once './Classes/PHPExcel/IOFactory. php ';
$ U = D ('clients ');
$ Data = $ _ SESSION ['datas'];

$ ObjPHPExcel = new PHPExcel ();
// Set properties
$ ObjPHPExcel-> getProperties ()-> setCreator ("ctos ")
-> SetLastModifiedBy ("ctos ")
-> SetTitle ("Office 2007 XLSX Test Document ")
-> SetSubject ("Office 2007 XLSX Test Document ")
-> SetDescription ("Test document for Office 2007 XLSX, generated using PHP classes .")
-> SetKeywords ("office 2007 openxml php ")
-> SetCategory ("Test result file ");

// Set width
$ ObjPHPExcel-> getActiveSheet ()-> getColumnDimension ('A')-> setWidth (8 );
$ ObjPHPExcel-> getActiveSheet ()-> getColumnDimension ('B')-> setWidth (10 );
$ ObjPHPExcel-> getActiveSheet ()-> getColumnDimension ('C')-> setWidth (25 );
$ ObjPHPExcel-> getActiveSheet ()-> getColumnDimension ('D')-> setWidth (12 );
$ ObjPHPExcel-> getActiveSheet ()-> getColumnDimension ('e')-> setWidth (50 );
$ ObjPHPExcel-> getActiveSheet ()-> getColumnDimension ('F')-> setWidth (10 );
$ ObjPHPExcel-> getActiveSheet ()-> getColumnDimension ('g')-> setWidth (12 );
$ ObjPHPExcel-> getActiveSheet ()-> getColumnDimension ('h')-> setWidth (12 );
$ ObjPHPExcel-> getActiveSheet ()-> getColumnDimension ('I')-> setWidth (12 );
$ ObjPHPExcel-> getActiveSheet ()-> getColumnDimension ('J')-> setWidth (30 );

// Set the row height
$ ObjPHPExcel-> getActiveSheet ()-> getRowDimension ('1')-> setRowHeight (22 );

$ ObjPHPExcel-> getActiveSheet ()-> getRowDimension ('2')-> setRowHeight (20 );

// Set font size bold
$ ObjPHPExcel-> getActiveSheet ()-> getDefaultStyle ()-> getFont ()-> setSize (10 );
$ ObjPHPExcel-> getActiveSheet ()-> getStyle ('A2: j1')-> getFont ()-> setBold (true );

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.