Probleme PHPExcel

Fermé
ahmed.ben.salem Messages postés 86 Date d'inscription lundi 31 mars 2008 Statut Membre Dernière intervention 28 avril 2009 - 3 nov. 2008 à 11:06
ahmed.ben.salem Messages postés 86 Date d'inscription lundi 31 mars 2008 Statut Membre Dernière intervention 28 avril 2009 - 3 nov. 2008 à 11:59
Bonjour,
J'ai un probleme avec la bibliothèque PHPExcel (PHP5), je veux lire un fichier xlsx (office 2007), voila le code :
<html>
<body>
<?php
//Here we set the include path and load the librarires
set_include_path(get_include_path() . PATH_SEPARATOR . '../PhpExcel2007/Classes/');
require_once('PHPExcel.php');
require_once('PHPExcel/IOFactory.php');

$excelReader = PHPExcel_IOFactory::createReader('Excel2007'); //we instantiate a reader object
$excel = $excelReader->load('test.xlsx'); //and load the document

print('<table border="1">');
for ($i = 2; $i < 5; $i++) {
    print('<tr>');
   
    print('<td>');
    print($excel->getActiveSheet()->getCell('A' . $i)->getValue()); //this is how we get a simple value
    print('</td>');
   
    print('<td>');
    print($excel->getActiveSheet()->getCell('B' . $i)->getValue());
    print('</td>');
   
    print('<td>');
    print($excel->getActiveSheet()->getCell('C' . $i)->getValue());
    print('</td>');
   
    print('<td>');
    print($excel->getActiveSheet()->getCell('D' . $i)->getCalculatedValue()); //this is how we get a calculated value
    print('</td>');
   
    print('</tr>');
}

print('<tr><td>&nbsp;</td><td>&nbsp;</td>');
print('<td>' . $excel->getActiveSheet()->getCell('C5')->getCalculatedValue() . '</td>');
print('<td>' . $excel->getActiveSheet()->getCell('D5')->getCalculatedValue() . '</td></tr>');
print('</table>');

?> 
</body>
</html>


Et voila le probleme lors de l'appel de ce script :
Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 2: parser error : Specification mandate value for attribute S in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209

Warning: simplexml_load_string() [function.simplexml-load-string]: g/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/iuieunxmlc="S in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 2: parser error : attributes construct error in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209

Warning: simplexml_load_string() [function.simplexml-load-string]: g/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/iuieunxmlc="S in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 2: parser error : Couldn't find end of Start Tag coreProperties line 2 in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209

Warning: simplexml_load_string() [function.simplexml-load-string]: g/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/iuieunxmlc="S in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209

Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 2: parser error : Extra content at the end of the document in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209

Warning: simplexml_load_string() [function.simplexml-load-string]: g/package/2006/metadata/core-properties" xmlns:dc="http://purl.org/iuieunxmlc="S in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209

Warning: simplexml_load_string() [function.simplexml-load-string]: ^ in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 209
bool(false)
Fatal error: Call to a member function registerXPathNamespace() on a non-object in C:\Program Files\EasyPHP 2.0b1\www\PHPExel\Classes\PHPExcel\Reader\Excel2007.php on line 211


Merci de m'aider les amis, je suis ploqué.
Merci d'avance,
A voir également:
  • Probleme PHPExcel
  • Phpexcel - Télécharger - Divers Web & Internet

1 réponse

ahmed.ben.salem Messages postés 86 Date d'inscription lundi 31 mars 2008 Statut Membre Dernière intervention 28 avril 2009 4
3 nov. 2008 à 11:59
Re,
Quelqu'un peut m'aider SVP, :(

Merci d'avance.
0