Page 1 sur 1

Probleme inclusion bibliotheque PHPExcel

Posté : 13 juin 2012, 13:31
par BaygonVert
Bonjour a tous !
Je me remets au php (arret de tout codage depuis plusieurs années) et je me retrouve donc certainement avec des problemes 'tous betes'...
J essaie dans un premier temps d utiliser la bib PHPExcel pour recopier un tableau Excel au format HTML, voici mon code :
<html>
<head>
<meta http-equiv="Content-Type" content="text/html; charset=UTF-8" />

<title>Transfert Excel > Table</title>

</head>
<body>

<?php
/** Include path **/
 set_include_path(get_include_path() . PATH_SEPARATOR . 'Classes/');

/** PHPExcel_IOFactory */
 require_once 'PHPExcel/IOFactory.php'; 



$inputFileName = "details.xls";
$objPHPExcel = PHPExcel_IOFactory::load($inputFileName);
$objWorksheet = $objPHPExcel->getSheet(0);

echo '<table border="1">';

foreach($sheet->getRowIterator() as $row)
	echo '<tr>';
	
	foreach($row->getCellIterator() as $cell) 
	{
		echo'<td>';
		print_r($cell->getValue());
		echo'</td>';
	}
	echo '<\tr>';
echo '</table>'

?>


</body>
Et voici le debut du code de "IOFactory.php" :
/**	PHPExcel root directory */
//echo 'tructruc';
if (!defined('PHPEXCEL_ROOT')) {
	/**
	 * @ignore
	 */
	define('PHPEXCEL_ROOT', dirname(__FILE__) . '/../');
	require(PHPEXCEL_ROOT . 'PHPExcel/Autoloader.php');
}

/**
 * PHPExcel_IOFactory
 *
 * @category   PHPExcel
 * @package    PHPExcel
 * @copyright  Copyright (c) 2006 - 2012 PHPExcel (http://www.codeplex.com/PHPExcel)
 */
class PHPExcel_IOFactory
{
	/**
	 * Search locations
	 *
	 * @var	array
	 * @access	private
	 * @static
	 */
...
}
Lors de l'execution de mon code, j ai une erreur fatale :
Fatal error: Class '�PHPExcel_IOFactory' not found in C:\Program Files (x86)\EasyPHP-5.3.9\www\ExcelToTable.php on line 20

pourtant le fichier IOFactory.php est bien inclus (testé via mon " echo 'tructruc' a la deuxieme ligne de IOFactory.php)

Voila voila, si vous avez une idée je suis preneur.

Re: Probleme inclusion bibliotheque PHPExcel

Posté : 13 juin 2012, 13:40
par xTG
Un problème d'encodage ? Un caractère non imprimable se baladant ?
Le ? du message d'erreur me tilt cela. :)

Re: Probleme inclusion bibliotheque PHPExcel

Posté : 13 juin 2012, 13:44
par BaygonVert
Merci xTG, j ai bien vu le ? et n ai pas reagi grrr, je recopierai 20 fois "je ne ferai plus de ctrl+C, ctrl+V a partir d une page web" :D

Re: Probleme inclusion bibliotheque PHPExcel

Posté : 15 juin 2012, 16:32
par reweb
Merci j'ai eu exactement le même problème