Ver Mensaje Individual
  #3 (permalink)  
Antiguo 19/11/2010, 15:51
gordot
 
Fecha de Ingreso: febrero-2010
Ubicación: cba
Mensajes: 203
Antigüedad: 14 años, 3 meses
Puntos: 16
Respuesta: Impresion toda mi consulta

me parece lo mas logico con el pop up como dice hidek1, asi te esta forma:

Código HTML:
<html>
<head>
<script language="JavaScript">
function Abrir_ventana (pagina) {
var opciones="toolbar=no, location=no, directories=no, status=no, menubar=no, scrollbars=no, resizable=yes, width=508, height=365, top=85, left=140";
window.open(pagina,"",opciones);
}
</script>
</head>
<body>
<a href="javascript:Abrir_ventana('popup.php')"><font size="1" face="Verdana">Imprimir todos los registros</font></a>
</body>
</html> 

y el popup.php:


Código PHP:
<?


$sql 
"SELECT * FROM clientes "

$rs mysql_query($sql); 

?>

<table align="left" border="1" bordercolor="#000">    
    <thead>
           <tr>  
                <td><h2>Id</h2></td>
                <td><h2>Razon Social</h2></td>    
                <td><h2>Socio</h2></td> 
                <td><h2>Fisica o Moral</h2></td> 
           </tr>    
    </thead> 
    <tbody>       
<?php
          
while ($row mysql_fetch_assoc($rs))   
          {            
         
$id $row["id"];           
         
$name htmlentities($row["nombre"]);    
         
$socio htmlentities($row["apellido"]);
         
$fm htmlentities($row["fecha_nac"]);        
?>          
    <tr>
<td><h3><?php echo $id?></h3></td>             
<td><h3><?php echo $name?></h3></td>         
<td><h3><?php echo $socio?></h3></td>             
<td><h3><?php echo $fm?></h3></td>             
    </tr>          
<?php         
}       
?>
<input type="button" name="imprimir" id="imprimir" value="Imprimir" onClick="window.print();" />
espero te sirva, saludos