Create Excel file using PHP Codeigniter
See this tutorial:
Here's a small (2.7 KB zipped) library to export XLS:
Here's a similar one to export XLSX (4.4 KB zipped):
Both have small working examples.
This has been answered at the following link:
Although it outputs a CSV MIME type, Excel is usually the default application for CSV.
Oops. Forgot the CodeIgniter part :)
Based on the above link, you can create a controller similar to the following, assuming CI 2.x
<?php if ( ! defined('BASEPATH')) exit('No direct script access allowed');class Csv extends CI_Controller { public function index() { header('Content-type: text/csv'); header('Content-disposition: attachment;filename=fromci.csv'); echo "order,id,Name,Address,Quantity,Price,Total".PHP_EOL; echo "1,1,XXXX,YYYYYYY,10,700,7000".PHP_EOL; }}
This excel.php
file could prove useful to you as an alternative to php-excel. I've never personally used it, but the description sounds like it could work for you.
http://www.phpclasses.org/package/1919-PHP-Stream-wrapper-to-read-and-write-MS-Excel-files.html