Foros del Web » Programación para mayores de 30 ;) » Java »

Java - iText

Estas en el tema de Java - iText en el foro de Java en Foros del Web. Hola, estoy desarrollando una aplicacion de gestion en java con la cual genero informes en pdf usando la libreria iText. No habia tenido ningun problema ...
  #1 (permalink)  
Antiguo 17/09/2008, 10:44
 
Fecha de Ingreso: septiembre-2008
Mensajes: 2
Antigüedad: 15 años, 7 meses
Puntos: 0
Java - iText

Hola, estoy desarrollando una aplicacion de gestion en java con la cual genero informes en pdf usando la libreria iText.

No habia tenido ningun problema hasta que he necesitado generar un pdf que muestra los resultados de una query, la cual puede llegar a ser bastante grande, con lo que el pdf necesita varias hojas para mostrar los resultados.

Consigo que me genere una nueva pagina controlando el tamaño máximo que puede ocupar en una hoja, pero cuando empieza a mostrarme el resto de resultados en la nueva pagina no muestra los que debería, sino que vuelve a mostrar casi todos los registros que devuelve la query.

Aki una pequeña muestra del codigo fuente:

public void generarInformeLiquidacionExposicionArtista(ArrayList lista,ArrayList lista2, int id, float totalPrecios,float totalPrecioCobrado, int numObras, float totalNetos, float totalGastos){
int cteSepFilas=30;
int leftPos=35;
int posIni = 540;
int numPag=1;
Utils a = new Utils();

exposicion obj = new exposicion(funciones.conexion());

try{

Utils.ImpLiquidacionExpDataHolder f = a.getImpLiquidacionExpDataHolder();
Utils.ImpLiquidacionGastosExpDataHolder g = a.getImpLiquidacionGastosExpDataHolder();
obj.seleccionar(id);

this.texto("informe de liquidación exposición artista",tamanyoTitulo,145,750,fuenteTitulo);
this.texto(obj.getTitulo(),tamanyoSubtitulo,280,70 5,fuenteTitulo);

this.texto("OBRAS EXPUESTAS: ",tamanyoTexto,55,670,fuenteSubtitulo);
this.texto(""+numObras,tamanyoTexto,155,670,fuente Texto);
this.texto("OBRAS VENDIDAS: ",tamanyoTexto,55,645,fuenteSubtitulo);
this.texto(""+totalPrecioCobrado,tamanyoTexto,155, 645,fuenteTexto);
this.texto("CIFRA EXPUESTA: ",tamanyoTexto,55,620,fuenteSubtitulo);
this.texto(""+totalPrecios,tamanyoTexto,155,620,fu enteTexto);
this.texto("CIFRA VENDIDA: ",tamanyoTexto,55,595,fuenteSubtitulo);
this.texto(""+totalPrecioCobrado,tamanyoTexto,155, 595,fuenteTexto);

this.texto("CODIGO",tamanyoTexto,55,560,fuenteSubt itulo);
this.texto("CLIENTE",tamanyoTexto,105,560,fuenteSu btitulo);
this.texto("PVP(€)",tamanyoTexto,265,560,fuenteSub titulo);
this.texto("P. COBRADO(€)",tamanyoTexto,325,560,fuenteSubtitulo);
this.texto("NETO ARTISTA",tamanyoTexto,415,560,fuenteSubtitulo);
this.texto("GALERIA",tamanyoTexto,505,560,fuenteSu btitulo);



int linea = 0;
for(int i=0;i<lista.size();i++){


f = ((Utils.ImpLiquidacionExpDataHolder)lista.get(i));


this.texto(f.codigo,tamanyoTexto,55,posIni-linea,fuenteTexto);
this.texto(f.cliente,tamanyoTexto,105,posIni-linea,fuenteTexto);
this.texto(f.pvp,tamanyoTexto,265,posIni-linea,fuenteTexto);
this.texto(f.pCobrado,tamanyoTexto,325,posIni-linea,fuenteTexto);
this.texto(f.netoArtista,tamanyoTexto,415,posIni-linea,fuenteTexto);
this.texto(f.galeria,tamanyoTexto,505,posIni-linea,fuenteTexto);

linea = linea + 25;

if((numPag==1) && nuevaPag(i+1,18)){

//if(numPag==1)
this.texto(Integer.toString(numPag),tamanyoSubtitu lo,300,30,fuenteSubtitulo);

Pdf.document.newPage();
numPag++;
i=0;
posIni = 1500;
this.escribeCabecera();

this.texto(Integer.toString(numPag),tamanyoSubtitu lo,300,30,fuenteSubtitulo);


}

}
this.texto(""+totalPrecioCobrado+"(€)",tamanyoText o,325,posIni-linea-10,fuenteSubtitulo);
this.texto(""+totalPrecios+"(€)",tamanyoTexto,415, posIni-linea-10,fuenteSubtitulo);
this.texto(""+totalNetos+"(€)",tamanyoTexto,505,po sIni-linea-10,fuenteSubtitulo);

this.texto("GASTOS A DESCONTAR",tamanyoSubtitulo,230,posIni-linea-50,fuenteTitulo);
this.texto("GASTOS A SU CARGO", tamanyoSubtitulo, 55, posIni-linea-85, fuenteSubtitulo);

this.texto("CONCEPTO", tamanyoTexto, 55, posIni-linea-105, fuenteSubtitulo);
this.texto("EMPRESA", tamanyoTexto, 155, posIni-linea-105, fuenteSubtitulo);
this.texto("PRECIO(€)", tamanyoTexto, 255, posIni-linea-105, fuenteSubtitulo);


}catch(Exception ex){

}
}

Gracias de antemano.
Un saludo.
  #2 (permalink)  
Antiguo 25/09/2008, 08:13
 
Fecha de Ingreso: septiembre-2008
Mensajes: 2
Antigüedad: 15 años, 7 meses
Puntos: 0
Respuesta: Java - iText

Ya lo tengo solucionado, pero gracias a todos los q lo hayan leido pa ver si me podian ayudar.

Un saludo.
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 16:14.