esta es la forma que funciona
Código PHP:
Ver original<?php
//insertamos los headers que van a generar el archivo excel
header('Content-type: application/vnd.ms-excel'); //en filename vamos a colocar el nombre con el que el archivo xls sera generado
header("Content-Disposition: attachment; filename=consulta.xls"); //recogemos la variable de fecha con la que limitaremos la cinsulta.
//hacemos la conexion al servidor MySql
//realizamos la consulta
$tipo = $_POST['tipo'];
$dato = $_POST['dato'];
$query=mysql_query ("SELECT * FROM entrada WHERE estilo='esteesmidato'"); ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Reporte de cosulta</title>
</head>
<body><!-Vamos a crear una tabla que será impresa en el archivo excel->
<!-creamos la tabla de el reporte con border 1 y los títulos->
<table width="641" border="1">
<tr>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Schedule</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Estilo</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Serie</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Id Tx</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Linia</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Area</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>KVAS</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Numero de reloj opererador</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Numero de reloj reparador</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Tipo de falla</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Codigo de falla</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Fase</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Fecha de entrada</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Comentarios</strong></th>
</tr>
<?php
// Un proceso repetitivo para imprimir cada uno de los registros.
echo
"<tr>
<td bgcolor=\"#ededed\" align=\"center\">$row[schedule]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[estilo]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[serie]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[idtx]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[linea]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[area]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[kvas]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[nrelojo]</td
<td bgcolor=\"#ededed\" align=\"center\">$row[nrelojr]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[falla]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[codigo]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[fase]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[fecha]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[comentarioe]</td>
</tr>";
}
?>
</table>
</table>
</body>
</html>
y esta es la forma que quiero que quede
Código PHP:
Ver original<?php
//insertamos los headers que van a generar el archivo excel
header('Content-type: application/vnd.ms-excel'); //en filename vamos a colocar el nombre con el que el archivo xls sera generado
header("Content-Disposition: attachment; filename=consulta.xls"); //recogemos la variable de fecha con la que limitaremos la cinsulta.
//hacemos la conexion al servidor MySql
//realizamos la consulta
$tipo = $_POST['tipo'];
$dato = $_POST['dato'];
$query=mysql_query ("SELECT * FROM entrada WHERE $tipo=$dato");
?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
<title>Reporte de cosulta</title>
</head>
<body><!-Vamos a crear una tabla que será impresa en el archivo excel->
<!-creamos la tabla de el reporte con border 1 y los títulos->
<table width="641" border="1">
<tr>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Schedule</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Estilo</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Serie</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Id Tx</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Linia</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Area</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>KVAS</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Numero de reloj opererador</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Numero de reloj reparador</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Tipo de falla</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Codigo de falla</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Fase</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Fecha de entrada</strong></th>
<th width="50%" style="background-color:#006; text-align:center; color:#FFF"><strong>Comentarios</strong></th>
</tr>
<?php
// Un proceso repetitivo para imprimir cada uno de los registros.
echo
"<tr>
<td bgcolor=\"#ededed\" align=\"center\">$row[schedule]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[estilo]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[serie]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[idtx]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[linea]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[area]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[kvas]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[nrelojo]</td
<td bgcolor=\"#ededed\" align=\"center\">$row[nrelojr]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[falla]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[codigo]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[fase]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[fecha]</td>
<td bgcolor=\"#ededed\" align=\"center\">$row[comentarioe]</td>
</tr>";
}
?>
</table>
</table>
</body>
</html>