Ver Mensaje Individual
  #1156 (permalink)  
Antiguo 09/05/2013, 09:08
rene_1008
 
Fecha de Ingreso: mayo-2013
Mensajes: 1
Antigüedad: 11 años
Puntos: 0
Respuesta: Jasper Report + iReport + NetBeans 4

/*Parametros para realizar la conexión*/
DataBase db=new DataBase();

Connection conexion;
/*Establecemos la ruta del reporte*/
File reportFile = new File(application.getRealPath("reportes/atrasos2.jasper"));


Map parameters = new HashMap();
parameters.put("fecha","02/04/2013");

conexion=db.getConexion();
byte[] bytes = JasperRunManager.runReportToPdf(reportFile.getPath (), parameters, conexion);

/*Indicamos que la respuesta va a ser en formato PDF*/
response.setContentType("application/atrasos2.pdf");
response.setContentLength(bytes.length);
ServletOutputStream ouputStream = response.getOutputStream();
ouputStream.write(bytes, 0, bytes.length);
ouputStream.flush();
ouputStream.close();

Alguien me podria ayudar xq stas linea de codigo no me ejecuta

byte[] bytes = JasperRunManager.runReportToPdf(reportFile.getPath (), parameters, conexion);

no entiendo xq??? :( de antemano muchas gracias!!!