Précédent   Forum des professionnels en informatique > PHP > Bibliothèques et frameworks > Bureautique
Bureautique Forum d'entraide sur la gestion dynamique de documents de bureautique (Word, Excel, OpenOffice...) avec PHP. Avant de poster -> Cours Excel, FAQ OpenXML, FAQ OpenDocument
Partagez cette discussion sur d'autres réseaux sociaux : Viadeo Twitter Google Facebook Digg Delicious MySpace Yahoo
Réponse Proposer ce sujet en actualité
 
Outils de la discussion
Publicité
'
Vieux 25/06/2008, 11h21   #1
Futur Membre du Club
 
Inscription : janvier 2008
Messages : 97
Détails du profil
Informations forums :
Inscription : janvier 2008
Messages : 97
Points : 15
Points : 15
Par défaut Export openoffice

Bonjour,

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

Code :
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 :
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 :
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.
nadiaflamingenierie est déconnecté   Envoyer un message privé Réponse avec citation 00
Vieux 12/07/2008, 18h30   #2
Rédacteur
 
Avatar de Yogui
 
Homme Guillaume Rossolini
Directeur technique
Inscription : février 2004
Messages : 13 720
Détails du profil
Informations personnelles :
Nom : Homme Guillaume Rossolini
Localisation : France

Informations professionnelles :
Activité : Directeur technique

Informations forums :
Inscription : février 2004
Messages : 13 720
Points : 17 355
Points : 17 355
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
__________________
Mes articles - Zend Certified Engineer (PHP + Zend Framework)
Ressources PHP - Ressources Zend Framework
Yogui est déconnecté   Envoyer un message privé Réponse avec citation 00
Réponse Proposer ce sujet en actualité
Outils de la discussion



Fuseau horaire GMT +2. Il est actuellement 18h11.


 
 
 
 
Partenaires

Hébergement Web