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
8
votes
1 answer

Laravel Excel how to load a view to specific row or cell?

I'm using Laravel Excel, I want to load a view file and set it to specific row. Is it possible to do it with laravel excel? bellow is the code for loading view in to the sheet: Excel::create('New file', function($excel) { $excel->sheet('New…
jones
  • 1,423
  • 3
  • 35
  • 76
8
votes
2 answers

Set cell background using column and row index

I am setting a cell value in phpexcel using below method setCellValueByColumnAndRow() $objPHPExcel->getActiveSheet()->setCellValueByColumnAndRow($col,$xlsRow,$plan); Now my requirment is to set background color for this. I am not able to use this…
ManiMuthuPandi
  • 1,594
  • 2
  • 26
  • 46
8
votes
2 answers

PHPExcel export "Unreadable Content" Excel File in yii2

I used PHPExcel extension in Yii2 project and i have created component of PHPExcel object but this component export "Unreadable Content" Excel file. I have read all possible solution for this issue from these links: PHPExcel - .xlsx file downloads…
GAMITG
  • 3,810
  • 7
  • 32
  • 51
8
votes
2 answers

PHPExcel - Clone sheet and keep its original style

I've tried to check every possible similar solution both here and in the PHPExcel official documentation / forums, but I didn't find any solution to my issue. The problem I'm trying to clone (or copy, being honest) a sheet to parse it into another…
briosheje
  • 7,356
  • 2
  • 32
  • 54
8
votes
4 answers

How to choose location to save file excel with PHPExcel

I have a problem when using PHPExcel to create a excel file. I want to choose location to save file excel but I don't know how do it. $model = new User(); $labels = $model->attributeNames(); $data = $model->findAll(); $objPHPExcel =…
Tam Vo
  • 175
  • 2
  • 3
  • 10
8
votes
2 answers

Insert image with Laravel-Excel

I'm using this package to generate excel documents with Laravel: https://github.com/Maatwebsite/Laravel-Excel However, documentation doesn't say anything about inserting images from files into my excel document. I'm pretty sure it's possible with…
Boring person
  • 443
  • 1
  • 5
  • 12
8
votes
3 answers

Import excel files with image in php/mysql

I want to make an import script which allows users to upload their excel file (extension not important) to my php application. The application should reconize a list of items (so far so good). The difficulty in this case is that the excel files…
Marcel
  • 81
  • 1
  • 1
  • 2
8
votes
1 answer

How to use print ready functionality in PHPExcel library

I am using PHPExcel library for spreadsheet operations. I am to apply print ready functionality. Does this functionality exist?
Vaishnavesh
  • 154
  • 1
  • 2
  • 13
8
votes
1 answer

PHPExcel set specific headers for file format

While googling I found two different sets of headers that need to be set when outputting excel generated in different file format. for e.g. For Type "Excel5" headers are: header("Pragma: public"); header("Expires: 0"); header("Cache-Control:…
Asif
  • 833
  • 2
  • 14
  • 23
8
votes
2 answers

PHPExcel exceeds memory usage only with XLS files

I'm having a memory issue with PHPExcel when processing an XLS file. I have to work with quite big files (between 50k and 200k rows, and 9-10 cols) so I had to use ReadFilters to solve the memory issue. However, although it worked pretty well with…
sergio0983
  • 1,232
  • 8
  • 15
8
votes
1 answer

PHPExcel conditional formatting when cell equals string

The following: $objConditional1 = new PHPExcel_Style_Conditional(); $objConditional1->setConditionType(PHPExcel_Style_Conditional::CONDITION_CONTAINSTEXT) ->setOperatorType(PHPExcel_Style_Conditional::OPERATOR_CONTAINSTEXT) …
Jimmyt1988
  • 20,466
  • 41
  • 133
  • 233
8
votes
2 answers

How to export html table to excel using PHPExcel?

Because it is hard to deal with different standards among different browsers, I give up trying to export html table using js or jQuery. I wonder if I can POST the table in html back to server and generate an .xls file on the server for user to…
Yongyiw
  • 248
  • 1
  • 4
  • 8
8
votes
2 answers

PHPExcel_Style_Fill infinite recursion

I use library PHPExcel 1.7.9 to work with Excel files. First, I create a template, stylise and polish it. Then, to avoid style hardcoding, using the above mentioned library I open that template, change some values and save it as a new .xlsx…
sybear
  • 7,837
  • 1
  • 22
  • 38
8
votes
3 answers

PhpExcel stops working after setting 20 cell types

I have a script that generates a little xls table (~25x15). It contains percentages and strings and i have an if operator that sets the current cell as percentage type with this…
Martin
  • 1,193
  • 3
  • 12
  • 24
8
votes
7 answers

PHPExcel generated excel file not working. (File format or extension is invalid )

PHPExcel generated excel file not working. (File format or extension is invalid) The example code of PHPExcel exceutes successfully on my local PC, the file gets downloaded to local and is opened in Excel 2007 successfully. But using the same code…
sqlchild
  • 8,754
  • 28
  • 105
  • 167