Results 1 to 5 of 5
  1. #1
    jeffreehy is offline Member
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0

    Default NetBeans 6.8 , iReport and Tomcat 6.0.18

    Hi, I builted a report in NetBeans 6.8 with iReport 3.7.4, (visual web Jsf page) with a button, to generate the report, the report gets generated ok, but when I close de report page the Tomcat server stops, I tryed with GlassFish, and the same simptom, what I'm doing wrong?
    here is the code
    Java Code:
        public String button1_action() {
            
            try {
                DriverManager.registerDriver((Driver) Class.forName("oracle.jdbc.driver.OracleDriver").newInstance());
    
            } catch (Exception ex) {
                respuesta.setText("");
                respuesta.setVisible(true);
                respuesta.setText("ERROR En Coneccion Base de Datos, Consulte Admon. de Sistemas ");
                return null;
              
            }
    
            String fechaProceso = fechaproceso.getText().toString();
            String cajeroNumero = cajero.getText().toString();
    
            try {
    
    
                JasperDesign jasperDesign = JRXmlLoader.load("C:/HONDUTEL/Reporte/report1.jrxml");
                JasperReport jasperReport = JasperCompileManager.compileReport(jasperDesign);
    
                Map parameters = new HashMap();
                parameters.put("fechaProceso", fechaProceso);
                parameters.put("cajeroNumero", cajeroNumero);
    
    
       
                Connection con = DriverManager.getConnection("jdbc:oracle:thin:@192.168.0.99:1521:cacilop", "hondutel", "hondutel");
                JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, parameters, con);
                JasperViewer.viewReport(jasperPrint);
            } catch (Exception ex) {
                String connectMsg = "Could not create the report " + ex.getMessage() + " " + ex.getLocalizedMessage();
                System.out.println(connectMsg);
            }
    
            return null;
        }

  2. #2
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    4

    Default

    public String button1_action() is a method? How did you call this?

  3. #3
    jeffreehy is offline Member
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0

    Default NetBeans 6.8 , iReport and Tomcat 6.0.18

    I call the method, from a jsf buttom. is a Web application, to generate a teller payments report.

  4. #4
    jeffreehy is offline Member
    Join Date
    Aug 2010
    Posts
    3
    Rep Power
    0

    Default

    Got it, in the sentence:

    Original

    JasperViewer.viewReport(jasperPrint);

    Modified:

    I changed to:

    viewReport(JasperPrint jasperPrint, boolean isExitOnClose)

    JasperViewer.viewReport(jasperPrint, false);

    the boolean isExitOnClose, it seems thet is true by default, I changed to false and it works.

    Thanks anyway.

  5. #5
    mine0926 is offline Senior Member
    Join Date
    Apr 2010
    Location
    Philippines
    Posts
    580
    Rep Power
    4

Similar Threads

  1. iReport netbeans tutorial
    By mine0926 in forum NetBeans
    Replies: 3
    Last Post: 08-16-2011, 11:12 AM
  2. Replies: 6
    Last Post: 08-19-2010, 01:54 PM
  3. New to JSP-Netbeans, external tomcat server
    By dropez in forum JavaServer Pages (JSP) and JSTL
    Replies: 8
    Last Post: 04-01-2009, 06:48 PM
  4. Tomcat In Eclipse - Sysdeo Tomcat Plug-in
    By JavaForums in forum Eclipse
    Replies: 1
    Last Post: 02-13-2008, 10:33 AM
  5. Jasper Report + iReport + NetBeans 4
    By Ed in forum NetBeans
    Replies: 2
    Last Post: 07-02-2007, 07:39 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •