phpexcel

PHPExcel - Formatting gets lost when editing from code

Hi all, I'm playing around with an PHP - MS Excel integration these days. My task is to open an existing spreadsheet, add some data and save the filled spreadsheet as a new file. Basically sort of a template filling engine, eventhough xlsx files are used as templates. I looked into PHPExcel which seems to be fairly nice framework. In o...

PHPExcel feature question

I want to know if PHPExcel can: Create Excel spreadsheets with embeded image. The image must be compressed (jpeg, png, gif...). Create Excel spreadsheets for different Excel versions (2000, 2003, 2007...). I'm pretty sure it can do this but I can't find it in the official docs. Anyone familiar with this class can help? Thanks! ...

php PHPExcel split Excel cell coordinate

currently, I used PHPExcel to import excel file, there is a function $cell->getCoordinate(); I would like to ask any solution for split the cell coordinate alphabet and integer? e.g A1, A2, I need to know currently which row, and until which column. I do some research about split, but not luck for it. Any idea? ...

PHPExcel how to set cell value dynamically

Hi All, 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', 'cell value here'); indicates that we have to hard code cell/column reference As...

PHPExcel set specific headers for file format

Hi, 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: must-revalidate, post-check=0, pre-check=0"); header("Content-Type: application/force-dow...

Multithreading/Parallel Processing in PHP

I have a PHP script that will generate a report using PHPExcel from data queried from a MySQL DB. Currently, it is linear in processing in that it gets the data back from MySQL, reads in the Excel template, writes the data to the template, then outputs it. I have optimized the code to the point that the data is only iterated over once, a...

Reading multiple files with PHPExcel

Hello there. I just recently started using this library (the one from CodePlex), but I ran into some issues. My goal is to use it so I can process some data from multiple Excel files, and send such data to a database, per file. I'm doing something like: foreach( $file_list as $file ) { $book = PHPExcel_IOFactory::load( $path . $fi...

PHP programming logic inquiry

Hello there. With the help of this community, I just recently solved some issues with PHPExcel reading multiple files through a foreach(). Now it seems I've got logic issues. I'm reading some excel files and extracting some data from them. This data are student grades. You can check a lightly modified code (I didn't paste it here becau...

Days since 1900

I'm using data from Excel2007 as parsed by PHPExcel, and dates come out as days since 1900. How can I convert to string of 'YYYY-MM-DD' (or anything similar)? ...

Import excel files with image in php/mysql

Hi all! 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 contain images...I've read information about phpexcel library but it does not say anyt...

PHP Excel - Correct format for strings / numbers beginning with zero?

Hi, I'm trying to use PHP to create a file containing a list of phone numbers. It's working OK however if the phone number begins with zero, the digit is dropped from the excel file. Does anyone know how to set the formatting correctly so that it remains in place? Any advice appreciated. Thanks. ...

PHP: return var doesn't work when var is huge?!

so i am using PHPExcel (http://phpexcel.codeplex.com/) to import a excel sheet. everything works fine on my development system, BUT it doesn't quite work on the live system. hence i debugged and looked what could be wrong. i got to a point where i found that a method obviously returned NULL, where it should have returned an object. i lo...

Rows written by PHPExcel cannot be read from other libraries

I know this isn't the right place to ask about this specific vague problem, but maybe someone knows this library well enough to enlighten me. Here is the thing: I am writting an Excel5 over an existing Excel file with PHPExcel. I need to upload that Excel to the Zoom website, so it can provide me with a list of tracking numbers. However...

Converting Digits into string

Hi All , 1)I have been working on fetching data from an excel sheet i can see on a cell written "Oct-10" but when i select it i see "10/31/2000" on fx column right at top ,when i fetch data from the .xls sheet using http://phpexcel.codeplex.com library version number 1.7.3 ,it is returning float("40482") , can any body tell how to conver...

Custom PHPExcel cell format only shown after double-click

I encountered a weird problem setting a custom date format with PHPExcel: I'm writing an sql formatted date to a cell and setting it's format with setFormatCode to 'd/m/y'. When I open it in Excel 2007, it shows the orignial date format until I double click the cell and then it's updated to my desired format. Is there a way to have it re...

PHPExcel how to get column index from cell

PHPExcel $cell->getColumn() returns 'A', 'B', 'C', ... which is the best way to get the integer (0, 1, 2, ...) from the cell. This function doesn't exist. $colIndex = $cell->getColumnIndex(); So what is the alternative withoput converting chr to ascii ? ...

How to fix a memory error in PHP?

Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 1078799 bytes) in D:\xampplite\htdocs\Scraper\PHPExcel\Reader\Excel2007.php on line 269 This error happens even when I just open a excel file of ~350 KB using PHPExcel. I am puzzled why 128 MB get exhausted when I just try to open a small excel ...

How to read multiple worksheet from a single excel file in php?

I have an excel sheet having three worksheets, I am having trouble in fetching records from second worksheet. All three worksheet is having different kind of records and with different fields, I try to google it but couldn't find a solution. ...

php_excel07- how to fix min heigth and mak to grow height based on the contents of a cell

I have to Export data to xlsx, where the exported file should be in a pre defined format. Becoz of these i am using "PHPexcel". And i created a template of some format with each row with some specified height. Actually in each cell i will be writing the data dynamically. so if the text is larger, then the row height in not increased. ...

php_excel07- how to replicate the properties of one row to next row

hi all, My application needs Export to xlsx, so i am using php_excel07. Everything is working fine but i am facing small issue, which is lik this: "I want to replicate the properties of row to next row". For Ex if i have row num 1 with predefined height, width, color and borders,etc..then these same properties of row1 have to be replicat...