salut,
je bloque sur l'erreur Some data has already been output can't send PDF file (output started at C:\wamp\www\appli\result_bdd.php:107).
la ligne 107 correspond à une ligne avec un "echo", j'ai déja utilisé cette page sans soucis depuis quelque jours mais là ça bloc j'ai tenté le ob_clean mais sans succès , voici mon code :
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
 
 
// Activation de la classe
			$pdf = new PDF('P','mm','A4');
			$pdf->AddPage();
			$pdf->SetFont('Helvetica','',11);
			$pdf->SetTextColor(0);
 
			// Position de l'entête à 10mm des infos (48 + 10)
				$position_entete = 58;
 
				function entete_table($position_entete){
				global $pdf;
				$pdf->SetDrawColor(183); // Couleur du fond
				$pdf->SetFillColor(221); // Couleur des filets
				$pdf->SetTextColor(0); // Couleur du texte				
				$pdf->SetY($position_entete);
				$pdf->SetX(8);
				$pdf->Cell(15,8,'OFS',1,0,'L',1);
				$pdf->SetX(23); // 8 + 96
				$pdf->Cell(15,8,'Phase',1,0,'C',1);			
				$pdf->SetX(38); // 104 + 10
				$pdf->Cell(25,8,'Date Envoi',1,0,'C',1);
				$pdf->SetX(63); // 104 + 10
				$pdf->Cell(35,8,'Receptionniste',1,0,'C',1);
				$pdf->SetX(98); // 104 + 10
				$pdf->Cell(35,8,'chauffeur',1,0,'C',1);
				$pdf->SetX(133); // 104 + 10
				$pdf->Cell(40,8,'Commentaire',1,0,'C',1);
				$pdf->SetX(173); // 104 + 10
				$pdf->Cell(13,8,'AOG',1,0,'C',1);
				$pdf->SetX(186); // 104 + 10
				$pdf->Cell(13,8,'RGE',1,0,'C',1);
				$pdf->Ln(); // Retour à la ligne
 
 
			}
 
			entete_table($position_entete);
 
 
 
		    $bdd = new PDO('mysql:host=localhost;dbname=application_v2', 'root', '');
 
			$requete="SELECT * FROM ofs";
			$resultats=$bdd->query($requete);
			$resultats->setFetchMode(PDO::FETCH_OBJ);
 
		   // construction du tableau HTML
		    print '<table border=1>
					<!-- impression des titres de colonnes -->
					 <TR>
						<TD>Choix</TD><TD>id ofs </TD><TD>PHASE</TD><TD>Date Envoi</TD><TD>receptionniste</TD><TD>chauffeur</TD><TD>commentaire </TD><TD>AOG </TD><TD>Rouge</TD>
					</TR>';
 
			 /* Récupère un tableau associatif */
 
 
				while( $resultat = $resultats->fetch() )
				{
 
					print'<TR>';
 
						$of_result =$resultat->id_ofs;
						$phase_result =$resultat->phase;
						$date_envoi_result =$resultat->date_envoi;
						$receptionniste_result = $resultat->receptionniste;
						$chauffeur_result = $resultat->chauffeur;
						$commentaire_result = $resultat->commentaire;
						$aog_result = $resultat->aog;
						$rouge_result = $resultat->rouge;
 
					echo"<td><input type='checkbox'  name='choix[]' value='$of_result.-.$phase_result.-.$date_envoi_result.-.$receptionniste_result.-.$chauffeur_result.-.$commentaire_result.-.$aog_result.-.$rouge_result'></td>";
						echo '<td>'.$resultat->id_ofs.'</td>';
						echo '<td>'.$resultat->phase.'</td>';
						echo '<td>'.$resultat->date_envoi.'</td>';
						echo '<td>'.$resultat->receptionniste.'</td>';
						echo '<td>'.$resultat->chauffeur.'</td>';
						echo '<td>'.$resultat->commentaire.'</td>';
						echo '<td>'.$resultat->aog.'</td>';
						echo '<td>'.$resultat->rouge.'</td>';
						echo '</TR>';
 
				}
 
					print '</TABLE>';
 
 
 
 
 
			if(!empty($_POST))
			{
 
				//echo '<b>Vous avez Sélectionné</b>  :<br> ';
				//$value_choix=null;
 
 
					// Liste des détails
					$position_detail = 66; // Position à 8mm de l'entête
					for ($i=0; $i<sizeof($_POST["choix"]); $i++)
					{
										//echo "taille post est : ".sizeof($_POST["choix"]);
										//unset($value_choix);
										$value_choix = explode(".-.",$_POST["choix"][$i]);
 
										$of_select=$value_choix[0];
										$phase_select = $value_choix[1];
										$date_envoi_select = $value_choix[2];
										$receptionniste_select = $value_choix[3];
										$chauffeur_select = $value_choix[4];
										$commentaire_select = $value_choix[5];
 
										$aog_select = $value_choix[6];
										$rouge_select = $value_choix[7];
 
										//echo"comment ".$i." ".$commentaire_select."<br>";
 
										$pdf->SetY($position_detail);
										$pdf->SetX(8);
										$pdf->MultiCell(15,15,$of_select,1,'C');
										$pdf->SetY($position_detail);
										$pdf->SetX(23);
										$pdf->MultiCell(15,15,$phase_select,1,'C');
										$pdf->SetY($position_detail);
										$pdf->SetX(38);
										$pdf->MultiCell(25,15,$date_envoi_select,1,'C');
										$pdf->SetY($position_detail);
										$pdf->SetX(63);
										$pdf->MultiCell(35,15,$receptionniste_select,1,'L');
										$pdf->SetY($position_detail);
										$pdf->SetX(98);
										$pdf->MultiCell(35,15,$chauffeur_select,1,'L');
										$pdf->SetY($position_detail);
										$pdf->SetX(133);
										//on fait un substr pour ne pas dépasser la longueur de la case
										$pdf->MultiCell(40,15,substr($commentaire_select,0,13),1,'L');
										$pdf->SetY($position_detail);
										$pdf->SetX(173);
										$pdf->MultiCell(13,15,$aog_select,1,'C');
										$pdf->SetY($position_detail);
										$pdf->SetX(186);
										$pdf->MultiCell(13,15,$rouge_select,1,'c');
 
										//incremente la boucle
										$position_detail += 15;	
 
 
					}
 
										// Nom du fichier
										$nom = 'Test-1.pdf';
										//Création du PDF					
										$pdf->Output($nom,'I');
										//ob_clean();
 
			}
 
		?>
		<input type="submit" value="VALIDER" />
		<input type="button" value="Retour" onclick="document.location.href='index.php'"/>
 
	</form>
pourriez vous m'aider?

merci d'avance