This extension is ... http://www.codeplex.com/PHPExcel Download from phpexcel-codeplex
protected/vendorsSee the following code example:
Yii::import('application.vendors.PHPExcel',true); $objReader = new PHPExcel_Reader_Excel5; $objPHPExcel = $objReader->load(@$_FILES['xls']['tmp_name']); $objWorksheet = $objPHPExcel->getActiveSheet(); $highestRow = $objWorksheet->getHighestRow(); // e.g. 10 $highestColumn = $objWorksheet->getHighestColumn(); // e.g 'F' $highestColumnIndex = PHPExcel_Cell::columnIndexFromString($highestColumn); // e.g. 5 echo '<table>' . "\n"; for ($row = 2; $row <= $highestRow; ++$row) { echo '<tr>' . "\n"; for ($col = 0; $col <= $highestColumnIndex; ++$col) { echo '<td>' . $objWorksheet->getCellByColumnAndRow($col, $row)->getValue() . '</td>' . "\n"; } echo '</tr>' . "\n"; } echo '</table>' . "\n";
Total 5 comments
After downloaded & extracted, this extention works perfectly. This is exactly what i need. Thank you very much.
:)
XLS Reader of this lib can't work with custom (currency) formatted cells. :( So I return to using of php-excel-reader. P.S. Maybe I can not right use search in them manual.
The file is too large,you can download from link。
This is a great idea but some files are missing from the zip file (the autoloader file for instance). I replaced the files in the PHPExcel folder with the one found on the official site, and it works fine.
Leave a comment
Please login to leave your comment.