Código PHP:
<?php
//esto indica al navegador que muestre el cuadro de dialogo
header("Content-type: application/octet-stream");
//indicamos al navegador que se está devolviendo un archivo
header("Content-Disposition: attachment; filename=reporte.xls");
//con esto evitamos que el navegador lo grabe en su caché
header("Pragma: no-cache");
header("Expires: 0");
?>
<table>
<tr>
<td style="font-weight: bold; text-align:center font-size: 1.5em; background-color:#BABA41; color:#fff" colspan="6">Informe de Paciente</td>
</tr>
<tr>
<td colspan="5"></td>
</tr>
</table>
<table border="1">
<thead>
<tr>
<td>Item</td>
<td>Cédula</td>
<td>Nombre</td>
<td>Antecedentes</td>
<td>Medicina</td>
<td>Estado</td>
</tr>
</thead>
<tbody>
<?php
$objemp=new Empleado();
$listados=$objemp->listado(date('2015-01-09'));
if(!empty($listados))
{
$i=1;
foreach ($listados as $datos) {
echo '<tr>
<td>'.$i++.'</td>
<td>'.$datos->getCedula().'</td>
<td style="width:80%">'.$datos->getNombre().'</td>
<td>'.MostrarAntecedentes($datos->getId()).'</td>
<td>'.MostrarMedicina($datos->getIdMed()).'</td>
<td>'.$datos->getEstado().'</td>
</tr>';
}
}
?>
</tbody>
</table>