Bonjour,
J'extrais des données MySQL dans un fichier Excel, mais j'ai toujours cette erreur à l'ouverture:
Comment faire pour l'éliminer?
Ci-joint mon code, merci par avance.
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 header("Content-type: application/vnd.ms-excel"); header("Content-Disposition: attachment; filename=monfichier.xls"); $tbl= "<table border='0' cellpadding='0' cellspacing='0'> <tr valign=center align=center bgcolor='#CCCCCC' style='font-weight:bold;'> <td>Outillage</td> <td>Date</td> <td>Ligne</td> <td>Cellule</td> <td>Emplacement</td> <td>Intervenant</td> <td>Commentaire</td> <td>Etat</td> </tr>"; while ($data = mysqli_fetch_array($sql)){ $tbl = $tbl."<tr valign=center align=center>"; $tbl = $tbl."<td>".$data['QRTool']." (".$data['type'].")"."</td>"; $tbl = $tbl."<td>".$data['sDate']."</td>"; $tbl = $tbl."<td>".$data['ID_line']."</td>"; $tbl = $tbl."<td>".$data['ID_cell']."</td>"; $tbl = $tbl."<td>".$data['position']."</td>"; $tbl = $tbl."<td>".$data['ID_intervenant']."</td>"; $tbl = $tbl."<td>".$data['comment']."</td>"; $tbl = $tbl."<td>".$data['breakdown_state']."</td>"; $tbl = $tbl."</tr>"; } $tbl = $tbl."</table>"; $tbl = utf8_decode($tbl); print $tbl ;
Partager