Ver Mensaje Individual
  #6 (permalink)  
Antiguo 13/10/2009, 10:41
Avatar de Jandor
Jandor
 
Fecha de Ingreso: septiembre-2009
Mensajes: 71
Antigüedad: 14 años, 7 meses
Puntos: 1
Respuesta: Problema al imprimir registros solo muestra uno de los 5 en dompdf

Por que no intentas asi

//Declara la variable $html fuera del while, y agrega la primera parte del codigo html, y abre la tabla.... yo supongo que lo que quieres es un tipo reporte, entonces es mejor crear una sola tabla, y que dinamicamente se creen las filas y columnas...

$html = "<HTML>
<HEAD>
<TITLE>grupo1.php</TITLE>
</HEAD>

<BODY>
<img src='logo.jpg' align='center'><br>
<br><br><br>
<h1><div align='center'>Control de Calificaciones</div></h1>
<br>
<br>

<table border='1' >";


while($p = mysql_fetch_array($result))

{


//Aqui vuelves a llenar la variable con los datos que te genera el while, el punto me indica que se van a concatenar los datos asi tu variable mantiene los datos anteriores...

$html .= "

<tr>
<th>Matrícula</th>
<th>Grupo</th>
<th>Turno</th>
<th>Semestre</th>
<th>Nombre</th>
<th>A. Paterno</th>
<th>A. Materno</th>
<th>Materia 1</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_1</th>
<th>Materia 2</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_2</th>
<th>Materia 3</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_3</th>
<th>Materia 4</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_4</th>
<th>Materia 5</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_5</th>
<th>Materia 6</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_6</th>
<th>Materia 7</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_7</th>
<th>Materia 8</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_8</th>
<th>Materia 9</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_9</th>
<th>Materia 10</th>
<th>cal_1</th>
<th>cal_2</th>
<th>prom_10</th>
<th>Prom. Gral</th>
</tr>


<tr>
<td>$p[matricula]</td>
<td>$p[grupo]</td>
<td>$p[turno]</td>
<td>$p[semestre]</td>
<td>$p[nombre]</td>
<td>$p[apaterno]</td>
<td>$p[amaterno]</td>
<td>$p[mat_1]</td>
<td>$p[cal_1]</td>
<td>$p[cal_2]</td>
<td>$p[prom_1]</td>
<td>$p[mat_2]</td>
<td>$p[cal_3]</td>
<td>$p[cal_4]</td>
<td>$p[prom_2]</td>
<td>$p[mat_3]</td>
<td>$p[cal_5]</td>
<td>$p[cal_6]</td>
<td>$p[prom_3]</td>
<td>$p[mat_4]</td>
<td>$p[cal_7]</td>
<td>$p[cal_8]</td>
<td>$p[prom_4]</td>
<td>$p[mat_5]</td>
<td>$p[cal_9]</td>
<td>$p[cal_10]</td>
<td>$p[prom_5]</td>
<td>$p[mat_6]</td>
<td>$p[cal_11]</td>
<td>$p[cal_12]</td>
<td>$p[prom_6]</td>
<td>$p[mat_7]</td>
<td>$p[cal_13]</td>
<td>$p[cal_14]</td>
<td>$p[prom_7]</td>
<td>$p[mat_8]</td>
<td>$p[cal_15]</td>
<td>$p[cal_16]</td>
<td>$p[prom_8]</td>
<td>$p[mat_9]</td>
<td>$p[cal_17]</td>
<td>$p[cal_18]</td>
<td>$p[prom_9]</td>
<td>$p[mat_10]</td>
<td>$p[cal_19]</td>
<td>$p[cal_20]</td>
<td>$p[prom_10]</td>
<td>$p[prom_gral]</td>
</tr>";
}

//Al finalizar el while solo vuelve a concatenar a la variable $html el cierre de la tabla y el resto de codigo html
$html .= "</table>
</BODY>
</HTML>";


Normalmente yo asi realizo los reporte, espero te sirva....