How do i read the content of an excel2007 file?

Topics: Developer Forum, User Forum
Mar 3, 2008 at 7:32 PM
I have looked for a sample code to read all the data of sheet 0 but i cant find it so i write here!

setincludepath(getincludepath() . PATHSEPARATOR . SOKVAGCLASSES .'Classes/');
include(SOKVAG_CLASSES. "/Classes/PHPExcel.php");
include SOKVAG_CLASSES .'Classes/PHPExcel/Reader/Excel2007.php';

// Skapar objekt
$objReader = new PHPExcelReaderExcel2007();

// Laddar in filen
$objPHPExcel = $objReader->load(SOKVAG_SYS.$filnamn);

My sheet is like this:

A B C D ...
1 1 1 1
2 2 2 2

Is it possible to get the value in an array like...

$arraySheet'A' = array(1,1,1,1)
$arraySheet'B' = array(1,1,1,1)

I want an simple code to take all the data från the sheet...but how?
Mar 4, 2008 at 6:50 AM
Will create a work item and implement a "toArray" and "fromArray" method.
Mar 4, 2008 at 6:52 AM
This discussion has been copied to a work item. Click here to go to the work item and continue the discussion.
Apr 19, 2008 at 9:13 PM
.. I don't understand :( Can you give an example code to load all the data of sheet into array?
Apr 21, 2008 at 5:37 AM
Check the "read" example in the tests folder of the PHPExcel download.
If you want an array, use the toArray() method of the worksheet.