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 :

[OpenOffice] Export OpenOffice


Sujet :

Bibliothèques et frameworks PHP

Vue hybride

Message précédent Message précédent   Message suivant Message suivant
  1. #1
    Membre confirmé
    Inscrit en
    Janvier 2008
    Messages
    97
    Détails du profil
    Informations forums :
    Inscription : Janvier 2008
    Messages : 97
    Par défaut [OpenOffice] Export OpenOffice
    Bonjour,

    je construit mon fichier open office (.odt) à l'aide de la fonction suivante:

    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
    public function Export()
    	{
    		$values=$this->collectSelectedItems();
       	    if($values)
       	      { 
       	      	 $this->MSG->Text="";
       	      	 $rep=$this->getApplication()->Parameters['PATH_Temp'];
       	         $donnees=new Fournisseur();
    	         $data=$donnees->GetInfosFrs($values[0]);	
     
    		     $rtf = new Rtf(); 
    		     $sect = &$rtf->addSection();
    		     $formatalign=new ParFormat('center'); 		     
    		     $format = new Font(20);
     
    		     $formatalign1=new ParFormat('left');
    		     $format1 = new Font(12);
     
    		     $fontSmall = new Font(3);
    		     $parBlack = new ParFormat(); 
                 $parBlack->setSpaceBefore(20); 
                 $parBlack1 = new ParFormat(); 
                 $parBlack1->setSpaceBefore(15);           
     
    		     $sect->emptyParagraph($fontSmall, $parBlack);
    		     $sect->writeText('<u><b>Fiche Fournisseur</b></u>', $format, $formatalign);
    		     $sect->emptyParagraph($fontSmall, $parBlack);  
    		     $sect->writeText('Société<tab><tab>:  '.$data[0]['Societe'], $format1, $formatalign1);
    		     $sect->emptyParagraph($fontSmall, $parBlack1); 
    		     $sect->writeText('Nom Contact<tab><tab>:  '.$data[0]['Nomfournisseur'], $format1, $formatalign1);
    		     $sect->emptyParagraph($fontSmall, $parBlack1);
    		     $sect->writeText('Prénom<tab><tab>:  '.$data[0]['Prenom'], $format1, $formatalign1);
    		     $sect->emptyParagraph($fontSmall, $parBlack1);
    		     $sect->writeText('Adresse<tab><tab>:  '.$data[0]['Adresse'], $format1, $formatalign1);
    		     $sect->emptyParagraph($fontSmall, $parBlack1);
    		     $sect->writeText('Pays<tab><tab>:  '.$data[0]['Pays'], $format1, $formatalign1);
    		     $sect->emptyParagraph($fontSmall, $parBlack1);
    		     $sect->writeText('Code Postal<tab><tab>:  '.$data[0]['CodePostal'], $format1, $formatalign1);
    		     $sect->emptyParagraph($fontSmall, $parBlack1);
    		     $sect->writeText('Ville<tab><tab>:  '.$data[0]['Ville'], $format1, $formatalign1);
                 $sect->emptyParagraph($fontSmall, $parBlack1);
                 $sect->writeText('Téléphone<tab><tab>:  '.$data[0]['Telephone'], $format1, $formatalign1);
                 $sect->emptyParagraph($fontSmall, $parBlack1);
                 $sect->writeText('Fax<tab><tab>:  '.$data[0]['Fax'], $format1, $formatalign1);
    		     $sect->emptyParagraph($fontSmall, $parBlack1);
    		     $sect->writeText('Email<tab><tab>:  '.$data[0]['EMail'], $format1, $formatalign1);
    		     $sect->emptyParagraph($fontSmall, $parBlack1);
    		     $sect->writeText('GSM<tab><tab>:  '.$data[0]['GSM'], $format1, $formatalign1);
     
     
    		     $rtf->save($rep.$data[0]['Nomfournisseur'].'.ODT');
     
    		     $url= $this->getApplication()->Parameters['PATH_Temp_Url'].$data[0]['Nomfournisseur'].'.ODT';
    	   	     $this->response->redirect($url);
     
       	      }
    }
    pour afficher ce fichier (.odt) à l'utilisateur:
    Code : Sélectionner tout - Visualiser dans une fenêtre à part
    1
    2
     $url= $this->getApplication()->Parameters['PATH_Temp_Url'].$data[0]['Nomfournisseur'].'.ODT';
    	   	     $this->response->redirect($url);
    mais cette façon ne fonctionne pas il m'affiche ça:

    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
    {\rtf\ansi\deff0 \r\n{\fonttbl{\f0 Times new Roman;}}
    {\colortbl;\red0\green0\blue0;}
    {\info
    }
    \deftab1298 \paperw11907 \paperh16443 \margl1701 \margr1701 \margt567 \margb1134 
    \pard \ql \sb400 {\fs6  \par}
    \pard \qc {\fs40 \ul \b Fiche Fournisseur\b0 \ul0 }
    \par \pard \ql \sb400 {\fs6  \par}
    \pard \ql {\fs24 Société\tab \tab :  flam123}
    \par \pard \ql \sb300 {\fs6  \par}
    \pard \ql {\fs24 Nom Contact\tab \tab :  test123}
    \par \pard \ql \sb300 {\fs6  \par}
    \pard \ql {\fs24 Prénom\tab \tab :  }
    \par \pard \ql \sb300 {\fs6  \par}
    \pard \ql {\fs24 Adresse\tab \tab :  }
    \par \pard \ql \sb300 {\fs6  \par}
    \pard \ql {\fs24 Pays\tab \tab :  }
    \par \pard \ql \sb300 {\fs6  \par}
    \pard \ql {\fs24 Code Postal\tab \tab :  }
    \par \pard \ql \sb300 {\fs6  \par}
    \pard \ql {\fs24 Ville\tab \tab :  }
    \par \pard \ql \sb300 {\fs6  \par}
    \pard \ql {\fs24 Téléphone\tab \tab :  }
    \par \pard \ql \sb300 {\fs6  \par}
    \pard \ql {\fs24 Fax\tab \tab :  }
    \par \pard \ql \sb300 {\fs6  \par}
    \pard \ql {\fs24 Email\tab \tab :  }
    \par \pard \ql \sb300 {\fs6  \par}
    \pard \ql {\fs24 GSM\tab \tab :  }
     
    }
    avez vous une idée sur ça?et comment résoudre ce problème?
    merci d'avance.

  2. #2
    Rédacteur

    Avatar de Yogui
    Homme Profil pro
    Directeur technique
    Inscrit en
    Février 2004
    Messages
    13 721
    Détails du profil
    Informations personnelles :
    Sexe : Homme
    Localisation : France, Yonne (Bourgogne)

    Informations professionnelles :
    Activité : Directeur technique

    Informations forums :
    Inscription : Février 2004
    Messages : 13 721
    Par défaut
    Salut

    Que contient la fonction redirect() ? J'aurais tendance à dire qu'il ne faut pas faire une redirection mais plutôt :
    • Envoyer les en-têtes d'OpenOffice
    • Afficher le contenu du fichier

Discussions similaires

  1. [XSLT][OpenOffice] Problème filtre d'export XML
    Par Maximil ian dans le forum XSL/XSLT/XPATH
    Réponses: 7
    Dernier message: 04/06/2011, 20h10
  2. Export sous OpenOffice
    Par Maglight dans le forum Langage
    Réponses: 4
    Dernier message: 28/04/2008, 08h02
  3. [MySQL] Exportation vers OpenOffice
    Par senacle dans le forum PHP & Base de données
    Réponses: 7
    Dernier message: 12/03/2008, 15h23
  4. [Export] Access vers openOffice
    Par Stargate SG1 dans le forum Access
    Réponses: 4
    Dernier message: 28/03/2007, 13h20
  5. [OpenOffice] exporter
    Par Husqvarna dans le forum Bibliothèques et frameworks
    Réponses: 10
    Dernier message: 10/08/2006, 17h13

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