Ver Mensaje Individual
  #1 (permalink)  
Antiguo 10/05/2004, 15:21
Aguante Kanario
 
Fecha de Ingreso: mayo-2004
Ubicación: Chilito lindo
Mensajes: 26
Antigüedad: 19 años, 11 meses
Puntos: 0
Exportar datos a excel

Buenas:

Tengo este programa:

<html>
<head>
<title>Documento</title>
<meta http-equiv="Content-Type" content="text/html; charset=iso-8859-1">
<link href="estilos.css" rel="stylesheet" type="text/css">
</head>

<body class="titulo">
<p class="titulo">INFORME</p>
<table border="1">
<tr class="texto_formulario">
<td>apellido_pat_becario</td>
<td>apellido_mat_becario</td>
<td>nombre_becario</td>
<td>rut_becario</td>
<td>fecha_nac</td>
<td>genero</td>
<td>mail1_becario</td>
</tr>
<?php do { ?>
<tr class="resultado_celda">
<td><?php echo $row_datos_informe1['apellido_pat_becario']; ?></td>
<td><?php echo $row_datos_informe1['apellido_mat_becario']; ?></td>
<td><?php echo $row_datos_informe1['nombre_becario']; ?></td>
<td><?php echo $row_datos_informe1['rut_becario']; ?></td>
<td><?php echo $row_datos_informe1['fecha_nac']; ?></td>
<td><?php echo $row_datos_informe1['genero']; ?></td>
<td><?php echo $row_datos_informe1['mail1_becario']; ?></td>
</tr>
<?php } while ($row_datos_informe1 = mysql_fetch_assoc($datos_informe1)); ?>
</table>
<p>&nbsp;</p>
<form name="form1" method="post" action="">
<input name="exportar_datos" type="submit" class="boton" id="exportar_datos" value="Exportar">
</form>
<p>&nbsp;</p>
</body>
</html>


Despues en pantalla se muestra la base de datos en pantalla.
Ese boton exportar me tiene q llevar a una plantilla excel...

este codigo le puse:

<?
header("Content-type: application/vnd.ms-excel");
header("Content-Disposition: attachment; filename=excel.xls");
?>


pero el problema es q muestra inmediatamente (abrir o guardar)
y necesito ver la BD ANTES DE EXPORTAR

Ahh se me olvidaba existe un menu antes q dice INFORME , apretando este, tiene q mostrarme la BD y luego EXPORTAR ....

__________________
Aguante San Luis- Este año en primera...