Questions tagged [phpexcel]

A PHP library to create, read, edit and write spreadsheet files for MS Excel and other spreadsheet programs

PHPExcel was a library written in pure PHP that provides methods to read workbook files generated by Excel and other spreadsheet programs (Excel 95 and higher .xls and .xlsx, Excel 2003 XML, Comma-Separated Value, SYLK, Gnumeric, and Open/Libre Office Calc .ods); to manipulate spreadsheet data and formatting; and to create/write to various formats (Excel BIFF8 .xls, Excel 2007 .xlsx, Comma-Separated Value, HTML, and PDF).

It is a component of the PHPOffice suite of libraries, comprising PHPExcel, PHPWord, PHPPowerPoint, PHPProject and PHPVisio.

The last production release of PHPExcel was version 1.8.1 in year 2015 via composer and git.

The final notice from PHPExcel is:

The project has not be maintained for years and must not be used anymore. All users must migrate to its direct successor PhpSpreadsheet, or another alternative.

Popular questions

Resources

Documentation

3639 questions
136
votes
2 answers

Alternative for PHP_excel

Is there any alternative for PHP_excel which can "Export to XLSX/XLS" file in a customized format? This is a General Reference question for the php tag
sandeep
  • 2,862
  • 9
  • 44
  • 54
123
votes
17 answers

PHPExcel auto size column width

I'm trying to auto size the columns of my sheet. I'm writing the file and in the end I try to resize all of my columns. // Add some data $objPHPExcel->setActiveSheetIndex(0) ->setCellValue('B1', 'test1111111111111111111111') …
Alkis Kalogeris
  • 17,044
  • 15
  • 59
  • 113
110
votes
7 answers

How to use phpexcel to read data and insert into database?

I have a php application where I want to read data from excel, Insert into database and then generate pdf reports for specific users. I searched a lot but nothing specific given about both things.
coder101
  • 1,601
  • 2
  • 21
  • 41
96
votes
10 answers

Set Background cell color in PHPExcel

How to set specific color to active cell when creating XLS document in PHPExcel?
user198003
  • 11,029
  • 28
  • 94
  • 152
90
votes
11 answers

PHPExcel Make first row bold

I am trying to make cells in first row are bold. This is the method I have created for that purpose. function ExportToExcel($tittles,$excel_name) { $objPHPExcel = new PHPExcel(); $objRichText = new PHPExcel_RichText(); // Set properties …
Rakesh
  • 2,730
  • 10
  • 39
  • 65
82
votes
8 answers

Setting width of spreadsheet cell using PHPExcel

I'm trying to set the width of a cell in an Excel document generated with PHPExcel…
user198003
  • 11,029
  • 28
  • 94
  • 152
80
votes
8 answers

phpexcel to download

hello i am new to phpexcel, and i was wondering if there is some way send the excel i have created to the clients download without saving it on my server or to delete it right after he downloads it i am trying to create an "export button" on a page…
Dvir Levy
  • 8,018
  • 11
  • 39
  • 60
65
votes
5 answers

how to make New lines in a cell using phpexcel

i have problem with php excel, i want to make new line in one cell but i can't, i have tried using \n or
but itsn't work. this my code: $objPHPExcel->getActiveSheet()->setCellValue('H5', 'Hello\nWorld'); // i need this show in two…
bungdito
  • 3,556
  • 4
  • 31
  • 38
65
votes
3 answers

PHPExcel and Text Wrapping

I know that this line of code will make the cell text-wrap: $objPHPExcel->getActiveSheet()->getStyle('D1')->getAlignment()->setWrapText(true); 'D1' being the chosen cell. Instead of using this code for every cell I need wrapped, is there a way to…
tehlivi
  • 790
  • 1
  • 12
  • 26
64
votes
7 answers

How to center the text in PHPExcel merged cell

How to center text "test"? This is my code:
user4035
  • 22,508
  • 11
  • 59
  • 94
61
votes
4 answers

Set Font Color, Font Face and Font Size in PHPExcel

I'm working in PHPExcel. I'm beginner.When I'm using following code and its working fine. $phpExcel = new PHPExcel(); $phpExcel->getActiveSheet()->getStyle("A1")->getFont()->setBold(true) ->setName('Verdana') …
som
  • 4,650
  • 2
  • 21
  • 36
54
votes
3 answers

phpexcel freeze row and columns

I'm trying to freeze the top row and the first 3 columns in a worksheet, using PHPExcel. I can freeze the row without any problem: $objPHPExcel->getActiveSheet()->freezePane('A2'); Or I can freeze the column without any…
CMR
  • 1,366
  • 4
  • 15
  • 31
51
votes
8 answers

PHPExcel very slow - ways to improve?

I am generating reports in .xlsx using PHPExcel. It was okay in the initial testing stages with small data sets (tens of rows, 3 sheets), but now when using it on a real production data with over 500 rows in each sheet, it becomes incredibly slow.…
SaltyNuts
  • 5,068
  • 8
  • 48
  • 80
51
votes
2 answers

PHPExcel how to set cell value dynamically

How to set cell/column value dynamically using PHPExcel library? I am fetching result set from MySQL database and I want to write data in excel format using PHPExcel library. Looking at example $objPHPExcel->getActiveSheet()->setCellValue('A1',…
Asif
  • 833
  • 2
  • 14
  • 23
49
votes
4 answers

How to set auto height in phpexcel?

I am using phpexcel to generate excel document with PHP. the question is, how to make auto height row using phpexcel? many thanks :)
bungdito
  • 3,556
  • 4
  • 31
  • 38
1
2 3
99 100