Foros del Web » Programando para Internet » PHP »

Problemas para presentar reportes

Estas en el tema de Problemas para presentar reportes en el foro de PHP en Foros del Web. Hola, tengo un problema, necesito crear un reporte en pdf, he probado varios sistemas para crear reportes, pero ninguno me ha funcionado correctamente, ya que, ...
  #1 (permalink)  
Antiguo 15/06/2011, 22:33
 
Fecha de Ingreso: junio-2011
Mensajes: 3
Antigüedad: 12 años, 10 meses
Puntos: 0
Problemas para presentar reportes

Hola, tengo un problema, necesito crear un reporte en pdf, he probado varios sistemas para crear reportes, pero ninguno me ha funcionado correctamente, ya que, tengo que mostrar alrededor de 15000 registros de datos, y al generar el reporte en pdf, supera la memoria asignada por el servidor, generándome un error, por este motivo no sé cómo hacer para generar ese reporte, si alguien conoce alguna forma de hacerlo suplico me ayuden,

Por cierto he tratado de segmentar el reporte, pero tan solo, se puede presentar 450 registros, pero de esta forma tendría que crear muchos reportes.
  #2 (permalink)  
Antiguo 16/06/2011, 06:09
Avatar de abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 11 meses
Puntos: 1517
Respuesta: Problemas para presentar reportes

Podrías mostrar lo que haz hecho.
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos
  #3 (permalink)  
Antiguo 16/06/2011, 13:13
 
Fecha de Ingreso: junio-2011
Mensajes: 3
Antigüedad: 12 años, 10 meses
Puntos: 0
Información Respuesta: Problemas para presentar reportes

Los reportes que tengo que presentar deben, poder guardarse de tal forma que no puedan ser modificados, teniendo en cuenta esto, la mejor manera de presentarlos, es con pdf.

Para hacer los reportesm he utilizado dos clases para hacer pdf, que son:
  • Tcpdf
  • pdfClassesAndFonts

en este momento estoy probando con reportlist pero no cumple exacta mente con los requisitos, ya que no permite exportarlos como pdf.
El código usado para Tcpdf es:

session_start ();
set_time_limit(0);

$nro=$_POST['Nro_proceso'];
include_once ('../scripts/conexion.php');
$obj_conexion = new conexion_mysql ();
$obj_conexion -> abrir_conexion ();
$sql_procesos = "
select
*
from proceso where nro_proceso=".$nro."
";
$consulta_procesos = $obj_conexion -> consulta_mysql ($sql_procesos);
$j=0;
if ($fila = mysql_fetch_array ($consulta_procesos))
{

$m_pro[0]=htmlentities($fila['id_proceso']);
$m_pro[1]=htmlentities($fila['nro_proceso']);

$sql_integrantes ="select d.cedula,d.nombre1,d.nombre2,d.apellido1,d.apellid o2,d.lugar,i.folio,i.poder
from
demandante d,
integrantes i
where
i.id_demandante=d.id_demandante and
i.id_proceso=".$m_pro[0]." and
(d.apellido1 LIKE '%a' or d.apellido1 LIKE '%A') order by apellido1 LIMIT 0,450";

$consulta_integrantes = $obj_conexion -> consulta_mysql ($sql_integrantes);
while ($fila_int = mysql_fetch_array ($consulta_integrantes))
{
$matriz[$j][0]=$fila_int['cedula'];
if($fila_int['nombre1']!="Sin asignar")
{
$matriz[$j][1]=htmlentities($fila_int['nombre1']." ".$fila_int['nombre2']);
}
else
{
$matriz[$j][1]=htmlentities($fila_int['nombre1']);
}
if($fila_int['apellido1']!="Sin asignar")
{
$matriz[$j][2]=htmlentities($fila_int['apellido1']." ".$fila_int['apellido1']);
}
else
{
$matriz[$j][2]=htmlentities($fila_int['apellido1']);
}
$matriz[$j][3]=$fila_int['poder'];
$matriz[$j][4]=$fila_int['folio'];
$j++;
}
}
$obj_conexion -> cerrar_conexion ();

require_once ('../clases/eng.php');
require_once ('../clases/tcpdf.php');

// creamos el nuevo documento PDF
$pdf = new TCPDF (PDF_PAGE_ORIENTATION, PDF_UNIT, PDF_PAGE_FORMAT, true, 'UTF-8', false);

// Instanciamos la informacion del documento
$pdf->SetCreator(PDF_CREATOR);
$pdf->SetAuthor('Pablo Perez'); // autor
$pdf->SetTitle('ejemplo1'); // titulo
$pdf->SetSubject('PPD'); // asunto
$pdf->SetKeywords('PPD, informe, final'); //palabras clave

// Instanciamos la informacion que aparecera por defecto en la cabecera.
$pdf->SetHeaderData(PDF_HEADER_LOGO, PDF_HEADER_LOGO_WIDTH, PDF_HEADER_TITLE, PDF_HEADER_STRING);

// set header and footer fonts
$pdf->setHeaderFont(Array(PDF_FONT_NAME_MAIN, '', PDF_FONT_SIZE_MAIN));
$pdf->setFooterFont(Array(PDF_FONT_NAME_DATA, '', PDF_FONT_SIZE_DATA));

// set default monospaced font
$pdf->SetDefaultMonospacedFont(PDF_FONT_MONOSPACED);

//set margins
$pdf->SetMargins(PDF_MARGIN_LEFT, PDF_MARGIN_TOP, PDF_MARGIN_RIGHT);
$pdf->SetHeaderMargin(PDF_MARGIN_HEADER);
$pdf->SetFooterMargin(PDF_MARGIN_FOOTER);

//set auto page breaks
$pdf->SetAutoPageBreak(TRUE, PDF_MARGIN_BOTTOM);

//set image scale factor
$pdf->setImageScale(PDF_IMAGE_SCALE_RATIO);

//set some language-dependent strings
$pdf->setLanguageArray($l);

// ---------------------------------------------------------

// set font
$pdf->SetFont('helvetica', 'B', 20);

// add a page
$pdf->AddPage();

//$pdf->Write(0, 'ACTA DE REUNION', '', 0, 'C', true, 0, false, false, 0);

$pdf->SetFont('helvetica', '', 8);

// -----------------------------------------------------------------------------

$tabla = '
<table cellspacing="0" cellpadding="5px" border="0" width = "638" >
<tr>
<td colspan="4" align = "center" style = "height: 40px; font-size: 40px; font-weight: bold;">Reporte Integrantes Proceso</td>
</tr>
<tr>
<td colspan="4" align = "center" style = "height: 40px; font-size: 40px; font-weight: bold">'.$m_pro[1]
.'</td>
</tr>';

$tabla.='
<tr>
<td align = "center" style = "height: 25px; font-size: 30px; font-weight: bold" border="1">
Documento identidad
</td>
<td align = "center" style = "height: 25px; font-size: 30px; font-weight: bold" border="1" width="400">
Nombre
</td>
<td align = "center" style = "height: 25px; font-size: 30px; font-weight: bold" border="1" width="50">
Poder
</td>
<td align = "center" style = "height: 25px; font-size: 30px; font-weight: bold" border="1" width="50">
Folio
</td>
</tr>';

$doom=0;

for($doom=0; $doom < $j; $doom++)
{
$tabla.='
<tr>
<td align = "center" style = "height: 20px; font-size: 20px;" border="1">'.$matriz[$doom][0]
.'</td>
<td align = "center" style = "height: 20px; font-size: 20px;" border="1">'.$matriz[$doom][1].' '.$matriz[$doom][2]
.'</td>
<td align = "center" style = "height: 20px; font-size: 20px;" border="1">'.$matriz[$doom][3]
.'</td>
<td align = "center" style = "height: 20px; font-size: 20px;" border="1">'.$matriz[$doom][4]
.'</td>
</tr>
';
}
$tabla.='
</table>';

$tbl = <<<EOD
$tabla
EOD;

$pdf -> writeHTML ($tbl, true, false, false, false, '');

// -----------------------------------------------------------------------------

//Close and output PDF document
$pdf -> Output('nro.pdf', 'I');

//================================================== ==========+
// END OF FILE
//================================================== ==========+
  #4 (permalink)  
Antiguo 16/06/2011, 13:16
Avatar de abimaelrc
Colaborador
 
Fecha de Ingreso: mayo-2009
Ubicación: En el planeta de Puerto Rico
Mensajes: 14.734
Antigüedad: 14 años, 11 meses
Puntos: 1517
Respuesta: Problemas para presentar reportes

¿Haz tratado fpdf?
__________________
Verifica antes de preguntar.
Los verdaderos amigos se hieren con la verdad, para no perderlos con la mentira. - Eugenio Maria de Hostos
  #5 (permalink)  
Antiguo 16/06/2011, 16:25
 
Fecha de Ingreso: junio-2011
Mensajes: 3
Antigüedad: 12 años, 10 meses
Puntos: 0
Respuesta: Problemas para presentar reportes

Cita:
Iniciado por abimaelrc Ver Mensaje
¿Haz tratado fpdf?
Este es el error que me sale

Allowed memory size of 33554432 bytes exhausted (tried to allocate 263329 bytes)

ya probé la clase fpdf, y lo mismo, si conoces otra forma te agradecería

Etiquetas: pdf, problemas_reportes, repotes
Atención: Estás leyendo un tema que no tiene actividad desde hace más de 6 MESES, te recomendamos abrir un Nuevo tema en lugar de responder al actual.
Respuesta




La zona horaria es GMT -6. Ahora son las 09:21.