Codeigniter+phpexcel implementing export Data to an Excel file _php instance
Source: Internet
Author: User
Phpexcel is a PHP class library for manipulating Officeexcel documents, based on Microsoft's OPENXML Standard and PHP language. You can use it to read and write spreadsheets in different formats. And CodeIgniter is a powerful PHP framework. They combine to make a great effect!
1. Preparatory work
Download phpexcel:http://phpexcel.codeplex.com
This is a powerful Excel library that only demonstrates the ability to export Excel files, most of which may not be possible.
2. Install Phpexcel to CodeIgniter
1) Unzip the contents of the Classes folder in the package into the Application\libraries\ directory, the directory structure is as follows:
--application\libraries\phpexcel.php
--application\libraries\phpexcel (folder)
2) Modify the application\libraries\phpexcel\iofactory.php file
--Change its class name from Phpexcel_iofactory to Iofactory and follow the CI class naming convention.
--change its constructor to public
3. After installation, write a controller that exports Excel
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