Lecture de fichier excel avec phpExcelReader
bonjour,
j'ai un léger soucis avec phpexcelreader,
j'ai suivi la doc fournie afin d'acéder et de lire un fichier excel sur mon poste de travail, tout d'abord j'ai constaté que ca ne fonctionnait pas avec des fichiers excel (.xlsx) néanmoins j'ai pu parcourir un fichier excel (.xls) mais il m'a généré des warnings qui renvoient au fichier reader.php.
Quelqu'un pourrait il avoir une solution à mes problèmes??
merci d'avance!!
voici le bout de code que j'utilise :
Code:
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16
| // ExcelFile($filename, $encoding);
$data = new Spreadsheet_Excel_Reader();
// Set output Encoding.
$data->setOutputEncoding('CP1251');
$fileName='C:\teste.xls';
$data->read($fileName);
error_reporting(E_ALL ^ E_NOTICE);
for ($i = 1; $i <= $data->sheets[0]['numRows']; $i++) {
for ($j = 1; $j <= $data->sheets[0]['numCols']; $j++) {
echo "\"".$data->sheets[0]['cells'][$i][$j]."\",";
}
echo "\n";
} |
et voici les warnings generes :
Notice: iconv() [function.iconv]: Detected an illegal character in input string in C:\wamp\www\pagesInsaJob\Excel\reader.php on line 1055
Notice: iconv() [function.iconv]: Detected an illegal character in input string in C:\wamp\www\pagesInsaJob\Excel\reader.php on line 1055
Notice: iconv() [function.iconv]: Detected an illegal character in input string in C:\wamp\www\pagesInsaJob\Excel\reader.php on line 1055