IdentifiantMot de passe
Loading...
Mot de passe oublié ?Je m'inscris ! (gratuit)
Navigation

Inscrivez-vous gratuitement
pour pouvoir participer, suivre les réponses en temps réel, voter pour les messages, poser vos propres questions et recevoir la newsletter

Bibliothèques et frameworks PHP Discussion :

[PHPExcel] Ecrire dans un fichier


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    816
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 816
    Points : 49
    Points
    49
    Par défaut [PHPExcel] Ecrire dans un fichier
    Bonjour à tous,

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

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
     
    <?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 :

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    ( ! ) 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
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    ( ! ) 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 suivi le tuto présent du devellopez, mais je n'arrive pas a comprendre cette erreur.

    Pourriez-vous m'indiquer le probleme

    Merci

    guigui69

  2. #2
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Étrange parce que ton code fonctionne.

    Essaie de debuguer comme ça pour voir :
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    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.
    }
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  3. #3
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    816
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 816
    Points : 49
    Points
    49
    Par défaut
    D'accord je regarde ca demain.

    c''est peut etre ma version du WAMP windows "uwamp"

    guigui69

  4. #4
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    816
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 816
    Points : 49
    Points
    49
    Par défaut
    Bonjour voici le resultat:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
    6
    7
    8
    9
    10
    11
    12
    13
    14
    15
    16
    17
    18
    19
    20
    21
    22
    23
    24
    25
    26
    27
    28
    29
    30
    31
    32
    33
    34
    35
    36
    37
    38
    39
    40
    41
    42
    43
    44
    45
    46
    47
    48
    49
    50
    51
    52
    53
    54
    55
    56
    57
    58
    59
    60
    61
    62
    63
    64
    65
    66
    67
    68
    69
    70
    71
    72
    73
    74
    75
    76
    77
    78
    79
    80
    81
    82
    83
    84
    85
    86
    87
    88
    89
    90
    91
    92
    93
    94
    95
    96
    97
    98
    99
    100
    101
    102
    103
    104
    105
    106
    107
    108
    109
    110
    111
    112
    113
    114
    115
    116
    117
    118
    119
    120
    121
    122
    123
    124
    125
    126
    127
    128
    129
    130
    131
    132
    133
    134
    135
    136
    137
    138
    139
    140
    141
    142
    143
    144
    145
    146
    147
    148
    149
    150
    151
    152
    153
    154
    155
    156
    157
    158
    159
    160
    161
    162
    163
    164
    165
    166
    167
    168
    169
    170
    171
    172
    173
    174
    175
    176
    177
    178
    179
    180
    181
    182
    183
    184
    185
    186
    187
    188
    189
    190
    191
    192
    193
    194
    195
    196
    197
    198
    199
    200
    201
    202
    203
    204
    205
    206
    207
    208
    209
    210
    211
    212
    213
    214
    215
    216
    217
    218
    219
    220
    221
    222
    223
    224
    225
    226
    227
    228
    229
    230
    231
    232
    233
    234
    235
    236
    237
    238
    239
    240
    241
    242
    243
    244
    245
    246
    247
    248
    249
    250
    251
    252
     
    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
    Je pense que le problème se situe à ce niveau

    PHPExcel_Writer_

    PHPExcel\Writer\.php

    non?
    Alors docteur c'est grave ?

  5. #5
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    $writer = new \PHPExcel_Writer_Excel5($excel);
    comme ça ?
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  6. #6
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    816
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 816
    Points : 49
    Points
    49
    Par défaut
    Dans quel niveau du code ?

    guigui69

    Sur mon serveur linux j'ai aussi mon erreur:

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     
    Warning: require_once(PHPExcel/Writer/.php): failed to open stream: No such file or directory in /var/www/com/Classes/exemple-export-commande-v2.php on line 17 Fatal error: require_once(): Failed opening required 'PHPExcel/Writer/.php' (include_path='.:/usr/share/php:/usr/share/pear:./') in /var/www/com/Classes/exemple-export-commande-v2.php on line 17
    Bonsoir,

    je reviens vers vous car je ne trouve pas à résoudre le probleme

    avec vous une piste?

    Est-ce qu'il un aure moyen pour charger les classes necessaire ?

    guigui69

  7. #7
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Je t'ai proposé une modification, tu ne m'as pas dit ce que ça avait donné.

    Partant de là, ce n'est pas la peine de relancer le sujet.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  8. #8
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    816
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 816
    Points : 49
    Points
    49
    Par défaut
    Bonsoir,

    justement dans un message précédent, je voulais savoir si ton code remplace un bout de code ou il faut le rajouter un endroit précis.

    guigui69

  9. #9
    Modérateur
    Avatar de sabotage
    Homme Profil pro
    Inscrit en
    Juillet 2005
    Messages
    29 208
    Détails du profil
    Informations personnelles :
    Sexe : Homme

    Informations forums :
    Inscription : Juillet 2005
    Messages : 29 208
    Points : 44 155
    Points
    44 155
    Par défaut
    Je pensais que tu arriverais tout seul à trouver la ligne qui parmi les 15 que comporte ton code, ressemble fortement à celle que j'ai écrite.
    N'oubliez pas de consulter les FAQ PHP et les cours et tutoriels PHP

  10. #10
    Membre du Club
    Profil pro
    Inscrit en
    Octobre 2006
    Messages
    816
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Octobre 2006
    Messages : 816
    Points : 49
    Points
    49
    Par défaut
    Bonjour,

    cela à l'air de fonctionner par contre le temps exécution dépasse plus de 30 secondes . Est-normale ?

    guigui69

Discussions similaires

  1. Ecrire \" dans un fichier
    Par photorelief dans le forum Langage
    Réponses: 2
    Dernier message: 14/09/2005, 15h56
  2. [JAR] Lire et Ecrire dans un fichier contenu dans un jar
    Par lipao17 dans le forum Général Java
    Réponses: 5
    Dernier message: 02/05/2005, 12h01
  3. Ecrire dans un fichier
    Par gibet_b dans le forum Linux
    Réponses: 5
    Dernier message: 25/04/2005, 20h11
  4. Ecrire dans un fichier grace à un trigger ?
    Par zigoo dans le forum PostgreSQL
    Réponses: 1
    Dernier message: 29/10/2004, 20h03
  5. Ecrire dans un fichier sans supprimer le reste
    Par koan_sabian dans le forum Linux
    Réponses: 4
    Dernier message: 20/02/2003, 15h44

Partager

Partager
  • Envoyer la discussion sur Viadeo
  • Envoyer la discussion sur Twitter
  • Envoyer la discussion sur Google
  • Envoyer la discussion sur Facebook
  • Envoyer la discussion sur Digg
  • Envoyer la discussion sur Delicious
  • Envoyer la discussion sur MySpace
  • Envoyer la discussion sur Yahoo