How to generate excel from the array using PHPExcel

/ By Arjun / Published on March 29, 2016

This tutorial will describe the usage of the PHPExcel library to generate an Excel file from a PHP array. Usage of PHPExcel library is very simple and easy. Just follow the below steps.

Similar Posts
CodeIgniter 4 – Export data to excel in CodeIgniter using PhpSpreadsheet
How to use PHPExcel with CodeIgniter?

1. First thing first – Download PHPExcel from – http://phpexcel.codeplex.com/

2. After downloading files Unzip the PHPExcel.zip files and we only need files and directories under the class directory. So just copy past the file from the class folder to your project folder. The below image shows that my folder structure.

3. Now include the PHPExcel.php file and create an object, just follow the comments.

How to generate excel from array using PHPExcel

I hope you like this Post, Please feel free to comment below, your suggestion and problems if you face - we are here to solve your problems.

1 1 vote
Article Rating
Subscribe
Notify of
guest
2 Comments
Oldest
Newest Most Voted
Inline Feedbacks
View all comments
Raaz N K
Raaz N K
4 years ago

Hi Arjun,

I worked with PHPExcel and facing an issue with a new row which is created by the library automaticall.

I have a master excel file and i’m trying to delete few rows from it and rewriting that using $objWriter = PHPExcel_IOFactory::createWriter($doc, ‘Excel5’); function.

But there is a empty row inserting after the actual data row.

Can you please help me out.

dskanth
dskanth
3 years ago

Thanks a lot for posting this example… really helped me !

trackback

[…] Similar PostsCodeIgniter 4 – Export data to excel in CodeIgniter using PhpSpreadsheetHow to use PHPExcel with CodeIgniter?How to generate excel from the array using PHPExcel […]

2
0
Would love your thoughts, please comment.x
()
x