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
15
votes
3 answers

How to Generate Excel File With Autofilters in PHP?

Okay, here's my dilemma. I've been working on a Wordpress plugin for Medical Marcom to automatically update his List of US Twitter Doctors. Basically, it provides the ability to create a form where users can request to be added to the list, requests…
JaidynReiman
  • 954
  • 3
  • 11
  • 22
15
votes
4 answers

PHPExcel can't save the file or download it

I'm trying to code a function in PHP to export some data to Excel file. The problem is if I save it to the server it does work, but if I try to send to the browser using php://output it just doesn't work. It doesn't even show the download window. I'…
LuferBRA
  • 175
  • 1
  • 1
  • 7
15
votes
1 answer

PHPExcel get column name relative to given column

Using PHPExcel, is it possible to get the name of a column located X number of columns to the left or right? Example, given column BZ, I'd like to return column name CB or BX. (2 to the right or left) Thanks
raidzero
  • 299
  • 1
  • 4
  • 13
15
votes
8 answers

Does PHP Have a "built-in" iterator in a Foreach loop?

I'm using a foreach loop to go through the REQUEST array, as I want to have an easy way to utilize the REQUEST array's keys and values. However, I also want to have a numerical index of how many times the loop has run, as I'm writing a spreadsheet…
Goldentoa11
  • 1,700
  • 2
  • 17
  • 29
15
votes
2 answers

Adding a new row with PHPExcel?

How can I add a new row to an existing .xls file using PHPExcel? Do I have to calculate the number of rows that already exist? If so, how can I do that for an excel file?
Novak
  • 2,760
  • 9
  • 42
  • 63
14
votes
2 answers

How can i change the style of the line chart generated with phpexcel?

I am generating a line chart using the example from Github library. What i want to have is the option to set few custom styles for each of the lines in the chart, as we do manually in the excel sheet like: Select Line in the chart, Format Data…
shasi kanth
  • 6,987
  • 24
  • 106
  • 158
14
votes
3 answers

Vertical Text in PHPExcel Cell

How can I print text vertically in a cell using PHPExcel class ? need to print like the above figure.
VishnuPrasad
  • 1,078
  • 5
  • 17
  • 36
14
votes
2 answers

PHPExcel How to apply styles and set cell width and cell height to cell generated dynamically

I have form that I generate its content to Excel through PHPExcel, my problem is that how can I set width and height and also styles to the heading cells. the excel generated demo is here: the excel i want is here: here is my code: for ($col =…
MJ X
  • 8,506
  • 12
  • 74
  • 99
14
votes
6 answers

PHPExcel Check if sheet exists

I am using phpExcel, and I can't find anything to check if a sheet exists. What I would like to accomplish is something like this: if(!$excel->sheetExists(1)){ $excel->createSheet(1); $sheet = $excel->setSheet(1); } // Do some stuff with the…
Get Off My Lawn
  • 34,175
  • 38
  • 176
  • 338
14
votes
4 answers

How to set cell padding in PHPExcel?

Does anyone know how it's possible to set cell padding in PHPExcel ? Searched for 30mins and still can't find a proper solution. There is no useful documentation on this.
Sliq
  • 15,937
  • 27
  • 110
  • 143
13
votes
6 answers

How to get phpexcel to keep leading 0s in phone numbers?

Here's the code i'm using right now to set the cell values. It works alright if the number has separators like . or / but when there's no separator it gets saved as int and the leading 0 is stripped …
Bogdan
  • 1,869
  • 6
  • 24
  • 53
13
votes
1 answer

phpexcel insert qrcode into excel and save it to client end

I was trying to export data to excel file with a QRcode within a cell. I googled up and tried for clue. Finally thought with adding a sample image file. then after with a phpqrcode image file. It is still not succeeded can you please help me…
Jimson Jose
  • 351
  • 2
  • 17
13
votes
1 answer

PHPExcel color to specific row

I am currently working with PHPExcel and I am trying to give 1 specific row a color, I have read Set Background cell color in PHPExcel already and I have try all of those options. Without luck! Maybe I do something wrong, but here it goes: …
user4433485
13
votes
3 answers

Invalid character found in sheet title

I'm trying to load an Excel file from a certain source with PHPExcel. I have no control over how these Excel files are generated and they need to be opened automatically with PHPExcel without human interaction (re-saving the file, etc). I'm getting…
BT643
  • 3,495
  • 5
  • 34
  • 55
13
votes
1 answer

Is there anyway in PHPExcel to hide values in an export?

I would like to be able to get the ID of my record in my sql statement: $result = $db->query("select id,FQDN, ip_address, ....."); However, I don't want it to show up in the export using headings: $headings = array('Name (FQDN)','Management IP…
user3120521
  • 141
  • 1
  • 2
  • 4