Page 1 sur 1

PHPExel Erreur

Posté : 13 janv. 2014, 12:07
par guigui69
Bonjour à tous,

je suis entrain de tester PHPExcel sous un WAMP (windows) et je bloque pour écrire dans un fichier

Code :
Sélectionner tout - Visualiser dans une fenêtre à part

Code : Tout sélectionner

<?PHP $path = './'; set_include_path(get_include_path() . PATH_SEPARATOR . $path); function __autoload($classe) { $fichier = str_replace('_',DIRECTORY_SEPARATOR, $classe ) . '.php' ; require_once($fichier) ; # Chargement de la classe. } $objet = new PHPExcel_Reader_Excel5(); $excel = $objet->load('../Examples/export-commande.xls'); $writer = new PHPExcel_Writer_Excel5($excel); $writer->save('autreFichier.xls'); $objet = PHPExcel_IOFactory::createReader('Excel5'); $excel = $objet->load('export-commande.xls'); $sheet = $excel->getSheet(0); $sheet->setCellValue('A50', 'MaitrePylos'); $writer = PHPExcel_IOFactory::createWriter($excel); $writer->save('Exemple14.xls'); ?>
J'ai erreur :

( ! ) Warning: require_once(PHPExcel\Writer\.php) [<a href='function.require-once'>function.require-once</a>]: failed to open stream: No such file or directory in C:\UwAmp\www\backup\bc\Classes\exemple-export-commande-v2.php on line 7


( ! ) Fatal error: require_once() [<a href='function.require'>function.require</a>]: Failed opening required 'PHPExcel\Writer\.php' (include_path='.;C:\php\pear;./') in C:\UwAmp\www\backup\bc\Classes\exemple-export-commande-v2.php on line 7

(j'ai la version 1.7.9)

J'ai testé la solution sur WAMP et LAMP meme probleme

Pourriez-vous m'indiquer le problème

Merci

guigui69

Re: PHPExel Erreur

Posté : 13 janv. 2014, 18:42
par moogli
salut,

y a rien qui te chose que la require_once(PHPExcel\Writer\.php)

la au pif je dirais que c'est ton autoload qui fou le brin en voulant faire bien :)

@+

Re: PHPExel Erreur

Posté : 13 janv. 2014, 23:25
par guigui69
J'ai modifié autoload comme ceci:

Code : Tout sélectionner

function __autoload($classe) { echo '<p>' . $classe . '</p>'; $fichier = str_replace('_',DIRECTORY_SEPARATOR, $classe ) . '.php' ; echo '<p>' . $fichier . '</p>'; require_once($fichier) ; # Chargement de la classe. }

Voici le result

Code : Tout sélectionner

PHPExcel_Reader_Excel5 PHPExcel\Reader\Excel5.php PHPExcel_Shared_String PHPExcel\Shared\String.php PHPExcel_Reader_Abstract PHPExcel\Reader\Abstract.php PHPExcel_Reader_IReader PHPExcel\Reader\IReader.php PHPExcel_Reader_DefaultReadFilter PHPExcel\Reader\DefaultReadFilter.php PHPExcel_Reader_IReadFilter PHPExcel\Reader\IReadFilter.php PHPExcel_Shared_OLERead PHPExcel\Shared\OLERead.php PHPExcel PHPExcel.php PHPExcel_Calculation PHPExcel\Calculation.php PHPExcel_Calculation_Function PHPExcel\Calculation\Function.php PHPExcel_CalcEngine_CyclicReferenceStack PHPExcel\CalcEngine\CyclicReferenceStack.php PHPExcel_CalcEngine_Logger PHPExcel\CalcEngine\Logger.php PHPExcel_Worksheet PHPExcel\Worksheet.php PHPExcel_IComparable PHPExcel\IComparable.php PHPExcel_CachedObjectStorageFactory PHPExcel\CachedObjectStorageFactory.php PHPExcel_CachedObjectStorage_Memory PHPExcel\CachedObjectStorage\Memory.php PHPExcel_CachedObjectStorage_CacheBase PHPExcel\CachedObjectStorage\CacheBase.php PHPExcel_CachedObjectStorage_ICache PHPExcel\CachedObjectStorage\ICache.php PHPExcel_Worksheet_PageSetup PHPExcel\Worksheet\PageSetup.php PHPExcel_Worksheet_PageMargins PHPExcel\Worksheet\PageMargins.php PHPExcel_Worksheet_HeaderFooter PHPExcel\Worksheet\HeaderFooter.php PHPExcel_Worksheet_SheetView PHPExcel\Worksheet\SheetView.php PHPExcel_Worksheet_Protection PHPExcel\Worksheet\Protection.php PHPExcel_Worksheet_RowDimension PHPExcel\Worksheet\RowDimension.php PHPExcel_Worksheet_ColumnDimension PHPExcel\Worksheet\ColumnDimension.php PHPExcel_Worksheet_AutoFilter PHPExcel\Worksheet\AutoFilter.php PHPExcel_DocumentProperties PHPExcel\DocumentProperties.php PHPExcel_DocumentSecurity PHPExcel\DocumentSecurity.php PHPExcel_Style PHPExcel\Style.php PHPExcel_Style_Supervisor PHPExcel\Style\Supervisor.php PHPExcel_Style_Font PHPExcel\Style\Font.php PHPExcel_Style_Color PHPExcel\Style\Color.php PHPExcel_Style_Fill PHPExcel\Style\Fill.php PHPExcel_Style_Borders PHPExcel\Style\Borders.php PHPExcel_Style_Border PHPExcel\Style\Border.php PHPExcel_Style_Alignment PHPExcel\Style\Alignment.php PHPExcel_Style_NumberFormat PHPExcel\Style\NumberFormat.php PHPExcel_Style_Protection PHPExcel\Style\Protection.php PHPExcel_Shared_CodePage PHPExcel\Shared\CodePage.php PHPExcel_Shared_OLE PHPExcel\Shared\OLE.php PHPExcel_Shared_Date PHPExcel\Shared\Date.php PHPExcel_Cell PHPExcel\Cell.php PHPExcel_Cell_DataType PHPExcel\Cell\DataType.php PHPExcel_Writer_Excel5 PHPExcel\Writer\Excel5.php PHPExcel_Writer_Abstract PHPExcel\Writer\Abstract.php PHPExcel_Writer_IWriter PHPExcel\Writer\IWriter.php PHPExcel_Writer_Excel5_Parser PHPExcel\Writer\Excel5\Parser.php PHPExcel_WorksheetIterator PHPExcel\WorksheetIterator.php PHPExcel_Calculation_Functions PHPExcel\Calculation\Functions.php PHPExcel_Writer_Excel5_Workbook PHPExcel\Writer\Excel5\Workbook.php PHPExcel_Writer_Excel5_BIFFwriter PHPExcel\Writer\Excel5\BIFFwriter.php PHPExcel_Writer_Excel5_Worksheet PHPExcel\Writer\Excel5\Worksheet.php PHPExcel_Writer_Excel5_Xf PHPExcel\Writer\Excel5\Xf.php PHPExcel_Writer_Excel5_Font PHPExcel\Writer\Excel5\Font.php PHPExcel_Shared_OLE_PPS_File PHPExcel\Shared\OLE\PPS\File.php PHPExcel_Shared_OLE_PPS PHPExcel\Shared\OLE\PPS.php PHPExcel_Shared_Font PHPExcel\Shared\Font.php PHPExcel_Shared_OLE_PPS_Root PHPExcel\Shared\OLE\PPS\Root.php PHPExcel_Shared_File PHPExcel\Shared\File.php PHPExcel_IOFactory PHPExcel\IOFactory.php PHPExcel_Cell_DefaultValueBinder PHPExcel\Cell\DefaultValueBinder.php PHPExcel_Cell_IValueBinder PHPExcel\Cell\IValueBinder.php PHPExcel_Writer_ PHPExcel\Writer\.php
Comment corriger cette erreur ?

guigui69