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] Problème de conversion


Sujet :

Bibliothèques et frameworks PHP

  1. #1
    Membre éclairé
    Inscrit en
    Octobre 2006
    Messages
    446
    Détails du profil
    Informations forums :
    Inscription : Octobre 2006
    Messages : 446
    Par défaut [PHPExcel] Problème de conversion
    Bonjour ,
    je viens débuter avec PHPExcel en fait le problème c'est qu'il m'exporte ma page index.php .
    Je m'explique vu que je travaille avec les modules j'ai créer export_excel.php sous mon modules et j'ai fait
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    include ("Classes/PHPExcel.php");
    include ("Classes/PHPExcel/Writer/Excel2007.php");
    dans index.php .
    Puis je suis supposé faire l'appel de la sorte dans une autre page
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    <a href="index.php?modules=employe&opt=1">Export</a>
    Mais le problème comme je l'ai dis qu'il n'exporte pas les données que j'ai mis dans export_excel.php .
    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
    error_reporting(E_ALL);
     
    // Create new PHPExcel object
    $objPHPExcel = new PHPExcel();
     
    $sheet =$objPHPExcel->getActiveSheet();
    $sheet->setCellValue('A1','MaitrePylos');
    $sheet->setCellValue('B1','dddd');
    $sheet->setCellValue('C1','fcx');
    $sheet->setCellValue('D1','wq');
     
    // Set active sheet index to the first sheet, so Excel opens this as the first sheet
    //$objPHPExcel->setActiveSheetIndex(0);
     
     
    // Redirect output to a client's web browser (Excel5)
    header('Content-Type: application/vnd.ms-excel');
    header('Content-Disposition: attachment;filename="Testsimple.xls"');
    header('Cache-Control: max-age=0');
     
    $objWriter = PHPExcel_IOFactory::createWriter($objPHPExcel, 'Excel5');
    $objWriter->save('php://output');
    exit;
    Quelqu'un peut m'aider ?? merci

  2. #2
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 505
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 505
    Par défaut
    Peux-t-on voir la partie du code qui dit

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
     
     
    if($modules == 'employe'){

  3. #3
    Membre éclairé
    Inscrit en
    Octobre 2006
    Messages
    446
    Détails du profil
    Informations forums :
    Inscription : Octobre 2006
    Messages : 446
    Par défaut
    si j'ai bien compris votre question , dans l'index.php je mets ça dans la partie pour afficher le contenu d'une page .
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    if(isset($module)){
    		include($path_module.$module."/centre.php");
    Dans centre.php je mets les differentes pages possibles une sorte de switch case .

  4. #4
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 505
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 505
    Par défaut
    Je peux voir l'entièreté de la page index.php ?

  5. #5
    Membre éclairé
    Inscrit en
    Octobre 2006
    Messages
    446
    Détails du profil
    Informations forums :
    Inscription : Octobre 2006
    Messages : 446
    Par défaut
    Code php : 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
    <?php 
    session_start(); 
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
     
    <TITLE></TITLE>
    <META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
    <META content="MSHTML 5.00.2920.0" name=GENERATOR>
     
    <link rel="stylesheet" href="StyleMaster.css" type="text/css"> <!--ajouté pour connexion-->
     
     
     
    <script type="text/javascript" src="js/mootools.js"></script> -->
    <link rel="stylesheet" href="css/slimbox.css" type="text/css" media="screen" />
    <script type="text/javascript" src="table_sorter/jquery-latest.js"></script>
    <script type="text/javascript" src="table_sorter/jquery.tablesorter.js"></script>
     <script type="text/javascript" src="js/formcheck.js"></script>
     
     
     
     
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/slimbox2.js"></script>
     
     <script type="text/javascript" src="js/niceforms1.js"></script>  
    <script type="text/javascript" src="js/mootools.js"></script>
    <script type="text/javascript" src="formcheck/lang/fr.js"></script> 
    <script type="text/javascript" src="js/formcheck.js"></script>
     <script type="text/javascript">
    	window.addEvent('domready', function(){check = new FormCheck('third', {
    		display : {
    			fadeDuration : 500,
    			errorsLocation : 1,
    			indicateErrors : 1,
    			showErrors : 1
    		}
    	})});
    </script>
     
     
        <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>        
        <script src="js/jquery-ui-1.7.1.custom.min.js" type="text/javascript"></script> 
        <script src="js/jquery-ui-1.7.2.accordion.min.js" type="text/javascript"></script>  
     
                 <script type="text/javascript">            
                 var J = jQuery.noConflict() ; 
    			J(document).ready(function() {
                    J("#accordion").accordion();
                   // $("#demoFrame").attr("src", "");
                });
            </script> 
     
     
     
     
     
    	</head> 
     
     
     
    </head>
     
    <?php 
     
     
     
    include("config.php");
    $opt=@$_REQUEST['opt'] ;
    $module = @$_REQUEST['module'];
     
     
    $nom=@$_SESSION['user_nom'];
    $prenom=@$_SESSION['user_prenom'];
    $type=@$_SESSION['type'];
     
     
     
    ?>
    	<body> 
     
    		<div id="Wrapper"> 
    			<div id="Header"> 
     
    			    <div style="padding-top:40px;text-align:center;color:#2c58a5;font-size:24px"> SG </div>
    						 <h4 style="color: #2c58a5;margin-top:20px;text-align:center;font-size:16px">  </h4></td>
    </div>
                <div id="Body"> 
    				<div id="Content" >									
     
     
     
    			            <p>
    			            <table cellspacing="10" cellpadding="10"> 
    			                    <tr> 
    			                        <td width="250px" valign="top"> 
     
     
                                        <a href="index.php?module=joueurs&opt=0" >Export</a> 
    			                        </td> 
    			                        <td width="700px" valign="top"> 
                                          <?php   
     
    if(isset($module)){
    		include($path_module.$module."/centre.php"); 
    }else{include("modules/joueurs/acceuil.php");} //ajouter acceuil?>    </td> 
    			                    </tr> 
    			                </table>                            
                            </p> 
    				</div> 
    			</div>
                <div style="color:#FFF">
    				<p> 
     
    				</p> 
     
                </div>
                <div id="Footer"> 
    				<p> 
     
    				</p> 
    			</div> 
    		</div> 
     
     
        </form>		
    	</body> 
    </html>

  6. #6
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 505
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 505
    Par défaut
    je ne vois pas l'inclusion des class Excel

  7. #7
    Membre éclairé
    Inscrit en
    Octobre 2006
    Messages
    446
    Détails du profil
    Informations forums :
    Inscription : Octobre 2006
    Messages : 446
    Par défaut
    oui j'ai oublié ça mais le c'est toujours le meme problème

    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
    <?php 
    session_start(); 
    ?>
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd"> 
     <html xmlns="http://www.w3.org/1999/xhtml"> 
    <head> 
     
    <TITLE></TITLE>
    <META content="text/html; charset=iso-8859-1" http-equiv=Content-Type>
    <META content="MSHTML 5.00.2920.0" name=GENERATOR>
     
    <link rel="stylesheet" href="StyleMaster.css" type="text/css"> <!--ajouté pour connexion-->
     
     
     
    <script type="text/javascript" src="js/mootools.js"></script> -->
    <link rel="stylesheet" href="css/slimbox.css" type="text/css" media="screen" />
    <script type="text/javascript" src="table_sorter/jquery-latest.js"></script>
    <script type="text/javascript" src="table_sorter/jquery.tablesorter.js"></script>
     <script type="text/javascript" src="js/formcheck.js"></script>
     
     
     
     
    <script type="text/javascript" src="js/jquery.js"></script>
    <script type="text/javascript" src="js/slimbox2.js"></script>
     
     <script type="text/javascript" src="js/niceforms1.js"></script>  
    <script type="text/javascript" src="js/mootools.js"></script>
    <script type="text/javascript" src="formcheck/lang/fr.js"></script> 
    <script type="text/javascript" src="js/formcheck.js"></script>
     <script type="text/javascript">
    	window.addEvent('domready', function(){check = new FormCheck('third', {
    		display : {
    			fadeDuration : 500,
    			errorsLocation : 1,
    			indicateErrors : 1,
    			showErrors : 1
    		}
    	})});
    </script>
     
     
        <script src="js/jquery-1.3.2.min.js" type="text/javascript"></script>        
        <script src="js/jquery-ui-1.7.1.custom.min.js" type="text/javascript"></script> 
        <script src="js/jquery-ui-1.7.2.accordion.min.js" type="text/javascript"></script>  
     
                 <script type="text/javascript">            
                 var J = jQuery.noConflict() ; 
    			J(document).ready(function() {
                    J("#accordion").accordion();
                   // $("#demoFrame").attr("src", "");
                });
            </script> 
     
     
     
     
     
    	</head> 
     
     
     
    </head>
     
    <?php 
     
     
     
    include("config.php");
    include ("Classes/PHPExcel.php");
    include ("Classes/PHPExcel/Writer/Excel2007.php");
     
    $opt=@$_REQUEST['opt'] ;
    $module = @$_REQUEST['module'];
     
     
    $nom=@$_SESSION['user_nom'];
    $prenom=@$_SESSION['user_prenom'];
    $type=@$_SESSION['type'];
     
     
     
    ?>
     
     
    	<body> 
     
    		<div id="Wrapper"> 
    			<div id="Header"> 
     
    			    <div style="padding-top:40px;text-align:center;color:#2c58a5;font-size:24px"> SG </div>
    						 <h4 style="color: #2c58a5;margin-top:20px;text-align:center;font-size:16px">  </h4></td>
    </div>
                <div id="Body"> 
    				<div id="Content" >									
     
     
     
    			            <p>
    			            <table cellspacing="10" cellpadding="10"> 
    			                    <tr> 
    			                        <td width="250px" valign="top"> 
                                           <!-- rajouter pour connexion-->
                                        <a href="index.php?module=joueurs&opt=0" >Export</a> 
    			                        </td> 
    			                        <td width="700px" valign="top"> 
                                          <?php   
     
    if(isset($module)){
    		include($path_module.$module."/centre.php"); 
    }else{include("modules/joueurs/acceuil.php");} //ajouter acceuil?>    </td> 
    			                    </tr> 
    			                </table>                            
                            </p> 
    				</div> 
    			</div>
                <div style="color:#FFF">
    				<p> 
     
    				</p> 
     
                </div>
                <div id="Footer"> 
    				<p> 
     
    				</p> 
    			</div> 
    		</div> 
     
     
        </form>		
    	</body> 
    </html>

  8. #8
    Membre confirmé
    Profil pro
    Inscrit en
    Février 2009
    Messages
    153
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 153
    Par défaut
    j'ai exactement le même soucis, et je ne comprends par pourquoi !!!
    faut-il obligatoirement supprimer les balises html ?

  9. #9
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 505
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 505
    Par défaut
    La création du fichier Excel doit se faire dans un script a part de votre page Html

  10. #10
    Membre confirmé
    Profil pro
    Inscrit en
    Février 2009
    Messages
    153
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 153
    Par défaut
    en fait, j'ai avancé un peu plus sur le pb, du coup je ne sais pas si c'est vraiment le problème évoqué dans ce thread ... à voir ...

    Il semblerait que le fichier excel soit convenablement créé car lorsque je l'ouvre en double-cliquant sur toto.xlsx, il s'ouvre correctement dans mon excel (malgré la présence des balises html)
    Mais c'est le header qui ne fonctionne pas bien
    Je fais
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    header ("content-type: application/vnd.ms-excel");
    header("Content-Disposition:inline;filename=toto.xlsx");
    et j'ai l'erreur
    The file you are trying to open, "toto.xlsx-13.xls", is in a different format than specified by the file extension. Verify that the file is not corrupted and is from a trusted source before opening the file
    à l'ouverture dans excel.

    strange non ?

  11. #11
    Membre confirmé
    Profil pro
    Inscrit en
    Février 2009
    Messages
    153
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 153
    Par défaut
    mais pourquoi est-ce que j'ai toto.xlsx-13.xls ?? à l'ouverture de mon fichier ????
    alors que je spécifie bien filename=toto.xlsx ????
    Une idée ???
    J'espère que oui ..

  12. #12
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 505
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 505
    Par défaut
    Moi ce que je voudrais voir c'est le code

  13. #13
    Membre confirmé
    Profil pro
    Inscrit en
    Février 2009
    Messages
    153
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 153
    Par défaut
    voila :
    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
    <html>
    <head>
    </head>
    <body >
    <?php
     
    /** Error reporting */
    error_reporting(E_ALL);
     
    /** Include path **/
    ini_set('include_path', ini_get('include_path').';C:\\php\\PEAR\\PHPExcel\\;C:\\program files\\php\\pear\\PHPExcel\\');
     
    /** PHPExcel */
    include './scripts/phpexcel/Classes/PHPExcel.php';
     
    /** PHPExcel_Writer_Excel2007 */
    //include 'PHPExcel/Writer/Excel2007.php';
     
    // Create new PHPExcel object. Start drawing wait bar
     
    /*
     * echo "<html><head><title>MCA CRM Report Generator</title></head><body>\r\n";
     * echo "<span id=\"preload\">Generating Report, please wait...</span>\r\n";
     * echo "<span id=\"loadbar\"></span>\r\n"; 
     */
     
     
    $objPHPExcel = new PHPExcel();
     
    // Set properties
    // echo date('H:i:s') . " Set properties\n";
    $objPHPExcel->getProperties()->setCreator("MCA CRM Reporting");
    $objPHPExcel->getProperties()->setLastModifiedBy("MCA CRM Reporting");
    $objPHPExcel->getProperties()->setTitle("Dashboard By Sales Rep");
    $objPHPExcel->getProperties()->setSubject("Dashboard By Sales Rep");
    $objPHPExcel->getProperties()->setDescription("List of assigned clients by sales rep.");
     
     
    // Add some data
    // echo date('H:i:s') . " Add some data\n";
    $objPHPExcel->setActiveSheetIndex(0);
     
    // Here we populate the cells
    // echo date('H:i:s') . "Generating Report...\r\n";
    $objPHPExcel->getActiveSheet()->SetCellValue('A1', 'Sales Rep');
    $objPHPExcel->getActiveSheet()->SetCellValue('B1', 'Company Name');
    $objPHPExcel->getActiveSheet()->SetCellValue('C1', 'Client Status');
    $objPHPExcel->getActiveSheet()->SetCellValue('D1', 'Color Code');
    $objPHPExcel->getActiveSheet()->SetCellValue('E1', 'Last Call Date');
    $objPHPExcel->getActiveSheet()->SetCellValue('F1', 'Last Call Status');
    $objPHPExcel->getActiveSheet()->SetCellValue('G1', 'Last Call Spoke With');
    $objPHPExcel->getActiveSheet()->SetCellValue('H1', 'Next Callback Date');
    $objPHPExcel->getActiveSheet()->SetCellValue('I1', 'Last Call Sale Status');
    $objPHPExcel->getActiveSheet()->SetCellValue('J1', 'State');
    $objPHPExcel->getActiveSheet()->SetCellValue('K1', 'Sale Cycle Status');
    $objPHPExcel->getActiveSheet()->SetCellValue('M1', 'Generated on:');
    $objPHPExcel->getActiveSheet()->SetCellValue('N1', date('m/d/Y H:i:s'));
    $objPHPExcel->getActiveSheet()->SetCellValue('M2', 'Number of Records:');
     
    /*
     * echo "<script type=\"text/javascript\">\r\n";
     * echo "	document.getElementById('preload').innerHTML = 'Nearly finished, please wait...';\r\n";
     * echo "</script>\r\n";
     */
     
     
    // echo date('H:i:s') . "Finished generation, cleanup and output...\r\n";
    // Auto-fit the columns
    $objPHPExcel->getActiveSheet()->getColumnDimension('A')->setAutoSize(true);
    $objPHPExcel->getActiveSheet()->getColumnDimension('B')->setAutoSize(true);
    $objPHPExcel->getActiveSheet()->getColumnDimension('C')->setAutoSize(true);
    $objPHPExcel->getActiveSheet()->getColumnDimension('D')->setAutoSize(true);
    $objPHPExcel->getActiveSheet()->getColumnDimension('E')->setAutoSize(true);
    $objPHPExcel->getActiveSheet()->getColumnDimension('F')->setAutoSize(true);
    $objPHPExcel->getActiveSheet()->getColumnDimension('G')->setAutoSize(true);
    $objPHPExcel->getActiveSheet()->getColumnDimension('H')->setAutoSize(true);
    $objPHPExcel->getActiveSheet()->getColumnDimension('I')->setAutoSize(true);
    $objPHPExcel->getActiveSheet()->getColumnDimension('J')->setAutoSize(true);
     
    // Rename sheet
    $objPHPExcel->getActiveSheet()->setTitle('Report');
     
     
    // Save Excel 2007 file
    // echo date('H:i:s') . " Write to Excel2007 format\n";
    $objWriter = new PHPExcel_Writer_Excel2007($objPHPExcel);
    $objWriter->save('toto.xlsx');
     
    //header ('Location:open_excel_file.php?file=toto.xlsx');
     
    header ("content-type: application/vnd.ms-excel");
    header("Content-Disposition:inline;filename=toto.xlsx");
     
     
    // Echo done
    // echo date('H:i:s') . " Done writing file.\r\n";
    /*
     * echo "<script type=\"text/javascript\">\r\n";
     * echo "	document.getElementById('preload').innerHTML = 'Finished!';\r\n";
     * echo "	window.location = '" . str_replace('.php', '.xlsx', $_SERVER["PHP_SELF"]) . "';\r\n";
     * echo "</script>\r\n";
     * echo "</body></html>";
     */
    ?>
    <?php
    echo "Done."
    ?>
    </body>
    </html>
    Merci MaitrePylos

  14. #14
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 505
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 505
    Par défaut
    Pour 2003-2007 écrit ceci

    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
    3
    4
    5
     
    header ("content-type: application/vnd.openxmlformats-officedocument.spreadsheetml.shee");
    header("Content-Disposition:inline;filename=toto.xlsx");
     
    $objWriter->save('php://output');

  15. #15
    Membre confirmé
    Profil pro
    Inscrit en
    Février 2009
    Messages
    153
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 153
    Par défaut
    j'ai malheureusement le même comportement

    Je suppose qu'il fallait ajouté un 't' à shee !! pour faire sheet !!


    Ca marche chez vous ?

  16. #16
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 505
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 505
    Par défaut
    Voir mon tuto, et oui ça marche

  17. #17
    Membre confirmé
    Profil pro
    Inscrit en
    Février 2009
    Messages
    153
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 153
    Par défaut
    j'avais fait tout le tuto ou presque ...
    il est

    cela dit j'ai toujours le même souci, je voudrais juste savoir si toi tu as des infos qui s'ajouter à ton nom de fichier que tu dois ouvrir.
    Par exemple, moi je dois ouvrir toto.xlsx et il tente d'ouvrir toto.xlsx-13.xls (avec le 13 qui s'incrémente à chaque fois que je refais un essai) ?

  18. #18
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 505
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 505
    Par défaut
    Tu save() dans le même répertoire sans supprimer l'ancien fichier.

  19. #19
    Membre confirmé
    Profil pro
    Inscrit en
    Février 2009
    Messages
    153
    Détails du profil
    Informations personnelles :
    Localisation : France

    Informations forums :
    Inscription : Février 2009
    Messages : 153
    Par défaut
    effectivement, l'incrément ajouté derrière le nom était lié au fait que le fichier existait déjà.
    Cela dit, même s'il n'existe pas, j'ai toujours le même souci

    J'ai contourné le problème en faisant
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    header ('Location:'nomfichier.xlsx');
    et ça marche très bien ?

    Est-ce un pb de procéder ainsi ?

  20. #20
    Modérateur

    Avatar de MaitrePylos
    Homme Profil pro
    DBA
    Inscrit en
    Juin 2005
    Messages
    5 505
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Âge : 52
    Localisation : Belgique

    Informations professionnelles :
    Activité : DBA
    Secteur : Service public

    Informations forums :
    Inscription : Juin 2005
    Messages : 5 505
    Par défaut
    Si cela fonctionne....c'est bon

    Néanmoins ton souci m'embête et je ne vois pas ce qui se passe.

    Tu veux pas me faire un Zip, que je teste ?

+ Répondre à la discussion
Cette discussion est résolue.

Discussions similaires

  1. problème de conversion de dimension dans BUSINESS OBJECT
    Par greatmaster1971 dans le forum Deski
    Réponses: 4
    Dernier message: 28/04/2014, 13h15
  2. - [CAST ou CONVERT] Problème de conversion de date
    Par Boublou dans le forum MS SQL Server
    Réponses: 2
    Dernier message: 06/07/2004, 14h31
  3. Problème de conversion 3DS->.X
    Par JBernn dans le forum DirectX
    Réponses: 5
    Dernier message: 08/04/2004, 19h08
  4. Problème de conversion unicode
    Par djmalo dans le forum C
    Réponses: 5
    Dernier message: 09/03/2004, 11h48
  5. Réponses: 11
    Dernier message: 02/09/2003, 14h20

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