Jump to content
We've recently updated our Privacy Statement, available here ×

gerson2002

Members
  • Posts

    2
  • Joined

  • Last visited

gerson2002's Achievements

Newbie

Newbie (1/14)

  • Week One Done
  • One Month Later
  • One Year In
  • First Post Rare
  • Conversation Starter Rare

Recent Badges

0

Reputation

  1. nop is not working Empleados.jrxml (The system cannot find the file specified) I have my empleados.jrxml file in the same directory with my jsp page
  2. I already created the report with ireport but now i want read that report in my jsp app i found this old example is using jasperreport 2.0.4 this my code <%@page import="net.sf.jasperreports.engine.*" %> <%@page import="java.util.*" %> <%@page import="java.io.*" %> <%@page import="java.sql.*" %> <% Connection conexion ; Class.forName("org.postgresql.Driver").newInstance(); conexion = DriverManager.getConnection("jdbc:postgresql://localhost:5432/antigua","postgres","grupo02antigua"); File reportFile = new File(application.getRealPath("Empleados.jasper")); Map parameters = new HashMap(); parameters.put("nombrepara", "valorpara"); byte[] bytes = JasperRunManager.runReportToPdf(reportFile.getPath(), parameters,conexion); response.setContentType("application/pdf"); response.setContentLength(bytes.length); ServletOutputStream outputStream = response.getOutputStream(); outputStream.write(bytes,0,bytes.length); outputStream.flush(); outputStream.close(); %> but is not working i already tryed File reportFile = new File(application.getRealPath("Empleados.jrxml")); and still doesnt work so any idea where i could find a exmaple to do this? any example to read reports in jsp. Thx
×
×
  • Create New...