Tag Archives: excel

PHPExcel – Error Cyclic Reference in Formula

Questions: I keep reciving this error “Cyclic Reference in Formula”. When I am trying to download my excel file. Now when im deleting the ‘=’ from formula’s from my file $this->exportObj->setActiveSheetIndex(0) ->setCellValue(strtoupper($this->abc[$currentColumn]).$currentLine, (str_replace(“=”, “”, $column)) ); I can download the file but ofcourse the formala won’t work.. This is my excel file: http://www.2shared.com/document/SPtnvq6e/excel.html What is… Read More »

PHPExcel – How can i read the Excel sheet row by row

Questions: How can i read Excel worksheet row by row using PHPExcel? I have a sheet contains more than 100000 rows, but i want to read only 500 rows. $sheetData = $objPHPExcel->getActiveSheet(); $highestRow = $sheetData->getHighestRow(); $highestColumn = $sheetData->getHighestColumn(); $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn); echo ‘<table>’; for ($row = 1; $row <= $highestRow; ++$row) { echo ‘<tr>’; for… Read More »

PHP to Excel, bold font

Questions: For transferring some data from to excel via php I am using this function for the creation of labels; function xls_label($row, $col, $value, $bold ) { echo pack(“ssssss”, 0x204, 8 + strlen($value), $row, $col, 0x0, strlen($value)); echo $value; } This adds a label in regular font. Now I was wondering what do I need… Read More »

PHPExcel: Download the Excel file on the client side

Questions: The problem was solved: For other users that may have this problem – notice the encoding of the PHP file. If you use PHPExcel it must be ANSII encoding and not UTF8, otherwise the EXCEL will be downloaded corruptly. The Headers that were added (answer 1) solved the problem after i changed the encoding… Read More »

Load excel file into PHP_Excel from variable

Questions: I currently have this file_put_contents($tmpfile, $attachments[0][‘body’]); $objPHPExcel = PHPExcel_IOFactory::load($tmpfile); The file I am reading is extracted from an email, so rather then writing it to a tempfile I would like to read it directly into phpexcel from a string (if that makes sense) $objPHPExcel = PHPExcel_IOFactory::load($attachments[0][‘body’]); I have looked at the php excel manual… Read More »

How to export data to an excel file using PHPExcel

Questions: I have taken the source code from limesurvey and have added the PHPExcel library to my limesurvey code to export data to an excel file after you click a link. Currently the excel file opens with some dummy data in it with no problems. I need to be able to add data dynamically from… Read More »

php + jqgrid + export to excel

Questions: Somebody knows a way to export the data from a jqgrid to excel? I want to do a report using this jqgrid that i think is awsome. But i need to save or print this report somehow, because is information to be keeped. Somebody knows any way?? Answers:

PHP Read xlsx Excel 2007 file

Questions: I am using oleread to read uploaded xls file. But I am not able to read xlsx files saved in excel-2007 format. can someone help me on how to read xlsx file in PHP. Answers: <?php require_once ‘simplexlsx.class.php’; if ( $xlsx = SimpleXLSX::parse(‘pricelist.xlsx’) ) { print_r( $xlsx->rows() ); } else { echo SimpleXLSX::parse_error(); }… Read More »

Excel date conversion using PHP Excel

Questions: i am reading date from excel which is in this format 12/5/2012 day/month/year using this code to read . using PHP EXCEL PHPExcel_Style_NumberFormat::toFormattedString($value[‘A’],’YYYY-MM-DD’ ); its working like charm converting the above date ’12/5/2012′ to ‘2012-12-05’ now the problem is if the date is lets says 18/5/2012 or you can say if i set day… Read More »