JSP (Java Server Page) - Reportes PDF CON JSP

 
Vista:

Reportes PDF CON JSP

Publicado por Andres (7 intervenciones) el 28/05/2007 18:09:34
HOLA ALGUIEN CONOCE UNA MANERA FACIL DE GENERAR REPORTES PDF UTILIZANDO CODIGO JSP, SI TIENEN UN EJEMPLO LO AGRADECERIA..
Valora esta pregunta
Me gusta: Está pregunta es útil y esta claraNo me gusta: Está pregunta no esta clara o no es útil
0
Responder

RE:Reportes PDF CON JSP

Publicado por Carlos Carrillo (12 intervenciones) el 28/05/2007 19:40:54
Saludos, una forma fácil como tal no conozco, yo te recomiendo utilizar Jasper iReports...
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reportes PDF CON JSP

Publicado por DaY (1 intervención) el 10/08/2016 03:15:45
Estimado yo tengo problemas con ireport y jaspereport junto jsp al momento de generar me salta una excepción del servidor tomcat!! Justo en el arreglo de bytes esa línea!!
Será que me pueden dar una ✋ gracias!!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reportes PDF CON JSP

Publicado por julian velazquez zapata (6 intervenciones) el 25/02/2008 18:51:18
ANDAMOS EN LAS MISMAS AMIGO

ay que seguir investigando jejejejjejeeee

nos vemos en el futuro...!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reportes PDF CON JSP

Publicado por betty (1 intervención) el 24/06/2008 21:09:22
hola, que tal, les pido un gran favorsote porfa me urge, lo que pasa que estoy haciendo un proyecto de una aplicacion web en donde yo pueda registrar datos pero esos datos los tomo de un acta de nacimiento visuizado en pdf.
espero que me puedan ayudar. les agredeceria por fa. gracias Dtb.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reportes PDF CON JSP

Publicado por ANDRES (7 intervenciones) el 24/06/2008 21:17:35
HOLA
COMO ESTAS
TE PODRIA COLABORAR PERO NO TE ENTIENDO MUY BIEN LO QUE QUIERES REALIZAR, SI QUIERES AGREGAME AL MESSENGER Y HABLAMOS HABER SI TE COLABORO. MI MSN ES [email protected]

BYE.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reportes PDF CON JSP

Publicado por JORGE LUIS LOZANO GRANADOS (6 intervenciones) el 23/03/2009 19:50:15
Ing. Andres

muchas grasias por el codigo que pone el numero de la pagina

me marco unos errorsillos pero alfinal funciono

NOS VEMOS EN EL FUTURO...!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reportes PDF CON JSP

Publicado por yordantarazona (1 intervención) el 08/08/2022 16:39:33
Hola.

Disculpa me podrías decir como del numero de pagina, por favor.
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reportes PDF CON JSP

Publicado por JOSE ANTONIO (1 intervención) el 26/02/2008 00:32:09
no ay nada vato

ay k seguir investigando aver k zale
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reportes PDF CON JSP

Publicado por Gerwin Rangel (1 intervención) el 03/01/2009 13:55:39
hola amigo tengo un proble q me urge estoy realizando un proyecto web con jsp y necesito generar un pdf con datos extraidos de la base de datos.. haber en q me puedes dar una ayuda..
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reportes PDF CON JSP

Publicado por luna triste (3 intervenciones) el 09/03/2009 19:37:36
Este es el codigo para crear lun PDF a traves de JSP utilizando DREAMWEAVER
primero genera un juego de registro y luego inserta el codigo que te falta, este es solo una guia...te puede ayudar un buen extrae todo lo que haya en la BD es de cir genera un reporte general...
Pero si sabes como generarlo de manera indivudual, es decir por registro que se encuentre en la BD me dices como, Salu2

<%@ page
language="java"
import="java.io.*,java.sql.*,com.lowagie.text.*,com.lowagie.text.pdf.*,java.awt.Color"
contentType="text/html; charset=utf-8"
errorPage=""
%><%@ include file="../Connections/gtech.jsp"%><%
Driver Driverrs_stock = (Driver)Class.forName(MM_gtech_DRIVER).newInstance();
Connection Connrs_stock = DriverManager.getConnection(MM_gtech_STRING,MM_gtech_USERNAME,MM_gtech_PASSWORD);
PreparedStatement Statementrs_stock = Connrs_stock.prepareStatement("SELECT * FROM gtech_des.stock ORDER BY FECHA_STOCK ASC");
ResultSet rs_stock = Statementrs_stock.executeQuery();
boolean rs_stock_isEmpty = !rs_stock.next();
boolean rs_stock_hasData = !rs_stock_isEmpty;
Object rs_stock_data;
int rs_stock_numRows = 0;

int Repeat1__numRows = -1;
int Repeat1__index = 0;
rs_stock_numRows += Repeat1__numRows;

String subtitulo="LVT";
String titulo="Reporte de STOCK";
String autor="GTECH CORPORATION";
int numero=0;

response.setContentType("application/pdf");
Document document=new Document();
ByteArrayOutputStream buffer=new ByteArrayOutputStream();
PdfWriter.getInstance(document, response.getOutputStream());
document.addAuthor(autor);
document.addCreator("Despacho");
document.addTitle("Reporte de STOCK");
document.addSubject("Reporte de STOCK");
document.open();

float[] widths1={1f};
PdfPTable table1=new PdfPTable(widths1);
PdfPCell cell1=new PdfPCell(new Paragraph(titulo));
cell1.setHorizontalAlignment(Element.ALIGN_CENTER);
cell1.setBorderColor(new Color(255,255,255));
table1.addCell(cell1);
PdfPCell cell2=new PdfPCell(new Paragraph(subtitulo));
cell2.setHorizontalAlignment(Element.ALIGN_CENTER);
cell2.setBorderColor(new Color(255,255,255));
table1.addCell(cell2);
table1.setWidthPercentage(100);
table1.setSpacingAfter(20f);
document.add(table1);

float[] widths2={0.30f,0.31f,0.31f,0.30f,0.31f,0.31f,0.30f,0.31f,0.31f,0.30f};
PdfPTable table2=new PdfPTable(widths2);

table2.addCell("Tecnico");
table2.addCell("Ciudad");
table2.addCell("Fecha");
table2.addCell("Cantidad de LVT");
table2.addCell("Serie LVT 1");
table2.addCell("Serie LVT 2");
table2.addCell("Serie LVT 3");
table2.addCell("Serie LVT 4");
table2.addCell("Serie LVT 5");
table2.addCell("Serie LVT 6");

while ((rs_stock_hasData)&&(Repeat1__numRows-- != 0)) {


table2.addCell( String.valueOf((((rs_stock_data = rs_stock.getObject("NOM_TEC"))==null || rs_stock.wasNull())?"":rs_stock_data)));
table2.addCell( String.valueOf((((rs_stock_data = rs_stock.getObject("CIU_TEC"))==null || rs_stock.wasNull())?"":rs_stock_data)));
table2.addCell( String.valueOf((((rs_stock_data = rs_stock.getObject("FECHA_STOCK"))==null || rs_stock.wasNull())?"":rs_stock_data)));
table2.addCell( String.valueOf((((rs_stock_data = rs_stock.getObject("CAN_LVT"))==null || rs_stock.wasNull())?"":rs_stock_data)));
table2.addCell( String.valueOf((((rs_stock_data = rs_stock.getObject("NOSERIE_LVT"))==null || rs_stock.wasNull())?"":rs_stock_data)));
table2.addCell( String.valueOf((((rs_stock_data = rs_stock.getObject("NOSERIE2_LVT"))==null || rs_stock.wasNull())?"":rs_stock_data)));
table2.addCell( String.valueOf((((rs_stock_data = rs_stock.getObject("NOSERIE3_LVT"))==null || rs_stock.wasNull())?"":rs_stock_data)));
table2.addCell( String.valueOf((((rs_stock_data = rs_stock.getObject("NOSERIE4_LVT"))==null || rs_stock.wasNull())?"":rs_stock_data)));
table2.addCell( String.valueOf((((rs_stock_data = rs_stock.getObject("NOSERIE5_LVT"))==null || rs_stock.wasNull())?"":rs_stock_data)));
table2.addCell( String.valueOf((((rs_stock_data = rs_stock.getObject("NOSERIE6_LVT"))==null || rs_stock.wasNull())?"":rs_stock_data)));
rs_stock_hasData = rs_stock.next();


}

table2.setWidthPercentage(100);
table2.setSpacingAfter(100f);
table2.setSpacingAfter(100f);
table2.setWidthPercentage(100);
table2.setWidthPercentage(100);
table2.setSpacingAfter(100f);
table2.setSpacingAfter(100f);
table2.setWidthPercentage(100);
table2.setSpacingAfter(100f);
table2.setWidthPercentage(100);

document.add(table2);

document.close();

rs_stock.close();
Statementrs_stock.close();
Connrs_stock.close();

DataOutput output=new DataOutputStream(response.getOutputStream());
byte[] bytes=buffer.toByteArray();
response.setContentLength(bytes.length);
for(int i=0;i<bytes.length;i++){output.writeByte(bytes[i]);}

%>
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

paginacion con itext

Publicado por JULIAN VELAZQUEZ ZAPATA (6 intervenciones) el 19/03/2009 17:44:45
hola a todos

aqui se tardan un poco en contestar jejje pero esta bien
los codigos estan mas que perfectos.

bueno les tengo otra pregunta.

alguin sabe como acer paginacion con itext
itext es una libreria para acer reportes pdf con jsp

bueno es todo

saludos julian

NOS VEMOS EN EL FUTURO...!

jueves 19/ MARZO / 2009
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:paginacion con itext

Publicado por lunatriste (3 intervenciones) el 01/05/2009 01:59:15
bien si te refieres ha hacer saltos de pagina donde lo requieres dentro de un archivo pdf en jsp... esto no c aun como c logra, lo ke si te puedo decir que puedes genera un ciclo for externo a los datos, es decir que lo crees desde donde inician estos, eso fue lo ke m explicaron no lo he practicado pero tiene logica, esto ira despues del siguiente codigo

while ((rs_stock_hasData)&&(Repeat1__numRows-- != 0)) {
for(condicion){

//Datos

} //cierra el for

}cierre de while

esto es en todo lo ke te puedo ayudar espero te sirva la idea...

Salu2
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:paginacion con itext

Publicado por JULIAN VELAZQUEZ ZAPATA (6 intervenciones) el 02/06/2009 02:34:33
muchas grasias por la respuesta
le ise unos ajustes y me funciono

bueno mas bien me base en eso para acer la paginacion

grasias

NOS VEMOS EN EL FUTURO...!
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reportes PDF CON JSP

Publicado por Santiago Matiz (1 intervención) el 05/03/2010 17:23:39
Excelente ...

Mucha gracias
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar

RE:Reportes PDF CON JSP

Publicado por isaac castillo palacios (1 intervención) el 16/10/2012 01:17:47
hola alguien me puede ayudar lo que pasa es que estoi haciendo un pagina web con servlet y jsp donde quiero generara un pdf con itext pero de forma horizontal y ademas poner una imagen de encabezado
Valora esta respuesta
Me gusta: Está respuesta es útil y esta claraNo me gusta: Está respuesta no esta clara o no es útil
0
Comentar