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.