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

Copy and paste styles from one row to other

I'm using PHP Excel to create an Excel using a template Excel file. The problem is I have a datagrid and which I styled the header and first row in template. Here how it looks like: The top leftmost coordinate is C49. If I have 100 rows, I need to…
Cihad Turhan
  • 2,749
  • 6
  • 28
  • 45
7
votes
1 answer

How to avoid losing macros in PHPExcel?

I'm using PHPExcel to read data from a database and put it into a spreadsheet. I also have a template (.xlsm file) to be followed. As everybody knows, PHPExcel doesn't support macros. But I don't want to edit or create the macros. I just wanna make…
Dennis Braga
  • 1,448
  • 3
  • 20
  • 40
7
votes
2 answers

PHPExcel Freezepane not working

for ($char = 'A'; $char <= 'Z'; $char++) { $objPHPExcel->getActiveSheet()->setCellValue($char.'5','40'); } for ($i=1;$i<=100;$i++){ …
Bharanikumar
  • 25,457
  • 50
  • 131
  • 201
7
votes
1 answer

PHPExcel save file

Hi all I have a site and i want to create an excel file and save into my folder into my server. I have tried in this mode but every time ask me to download it. I don't want that ask to download because after I have to create many xls is a report and…
Alessandro Minoccheri
  • 35,521
  • 22
  • 122
  • 171
7
votes
3 answers

Combine two or more xls files as worksheets PHPExcel

I've been looking everywhere on how to do this with two existing files, looks like all documentation is on creating new files. I'd like to take one of the files and add the second file to it as a new worksheet then save it to the server. I've been…
user2430227
  • 303
  • 1
  • 3
  • 13
7
votes
2 answers

How to Apply Borders to All Cells, Not a Range!

I have got my Excel reader to work but there is an annoying problem where I can only find information on how to apply a border to a range of cells, which is useless for my application. Users upload Excel sheets that can be viewed later on. So the…
imperium2335
  • 23,402
  • 38
  • 111
  • 190
7
votes
2 answers

calculating sum with PHPExcel

I am new with PHPExcel and I need your help- I have problem with setCellValue in PHPExcel when calculating the sum. It gives me always 0. Here is my code: $objPHPExcel = PHPExcel_IOFactory::load("test.xls"); $row = 5; $S =…
Lilou
  • 179
  • 1
  • 5
  • 14
7
votes
1 answer

Set direction sheet in PHPExcel

I trying to export my database data to excel file, so I use PHPExcel classes. my sheet should be Right to left, How can I switch sheet direction to 'RTL' in PHPExcel ?
MajAfy
  • 3,007
  • 10
  • 47
  • 83
7
votes
1 answer

PHPExcel Comment

I am trying to insert a comment with in a cell. I am trying following code to comment but it is not showing comment within created excel. I am creating .xls…
Amit Garg
  • 3,867
  • 1
  • 27
  • 37
7
votes
2 answers

PHPExcel row autoheight on merged cells w/ wrapText

Is there a good way to set row autoheight in PHP Excel? So far I have seen that you can use a fixed height where you specify before hand how tall you want the row. I have also seen that you can use autoheight if you are not using merged…
aaron-bond
  • 3,101
  • 3
  • 24
  • 41
7
votes
3 answers

PHPExcel Piechart labels and legends

I have a problem with the library PHPExcel (1.7.7): When I want to create a piechart, labels and legends are not displayed. However, with other graphics, I do not have that problem. Do you have any a solution? Thanks. Here is the code…
user1646114
  • 71
  • 1
  • 1
  • 2
7
votes
2 answers

PHPExcel set column width

I am setting column width for a .csv file using $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setWidth(50); But i cannot see any change in column A's width, what am i doing wrong?
Amna Ahmed
  • 1,944
  • 4
  • 20
  • 25
7
votes
1 answer

PHPExcel - How to set the default window size

I've looked through the PHPExcel examples and tried searching online, but I can't work out how to set the size of the window when the spreadsheet is first opened - the window is fairly small and I always have to resize it, which becomes a bit…
Noel Whitemore
  • 647
  • 1
  • 9
  • 20
6
votes
1 answer

Passing data from PHP class to PHPExcel via AJAX

i got stuck with OOP PHP and json data. i'm not completely new to OOP, but i can't get my head around this. if anyone can please explain to me, would be great! i have the following grid object in PHP: Class Grid { var $data; var…
Elen
  • 2,345
  • 3
  • 24
  • 47
6
votes
1 answer

How to convert HTML chars in PHPExcel?

Developing PHP application that generates Excel documents on the fly, using PHPExcel (http://phpexcel.codeplex.com/). Problem I have is that my Excel document will contain some special HTML chars, like °, ’, ” etc... But in generated…
user198003
  • 11,029
  • 28
  • 94
  • 152