Because I find NullPointerException in Netbeans 8.2 with Ireports in a single report

0

I generate this error in a specific report in the others no .. and I do not understand why ... this is my procedure to call the report, that only happens when I run the application, because in the netbeans with the ireport plugin if the report generates me

public void reporteproce(int idprocedimientos)
    {
        try 
        {
                ConexionBD cc = new ConexionBD();
                Connection conect = cc.conexion();
                //System.out.println(idprocedimiento);
                JasperReport reporte=(JasperReport) JRLoader.loadObject("ReporteBronc.jasper");
                Map parametro = new HashMap();
                parametro.put("idprocedimiento",idprocedimientos);
                JasperPrint j = JasperFillManager.fillReport(reporte, parametro,conect);
                JasperViewer jv =new JasperViewer(j,false);
                jv.setTitle("Broncocospia Respiratoria");
                jv.setVisible(true);
        }catch(Exception e)
                                {
                                JOptionPane.showMessageDialog(null,"Error al Mostrar Reporte "+e);
                                }
    }

..... this is the code of the button

    private void BReporteActionPerformed(java.awt.event.ActionEvent evt) {                                         
    //SI SE HA ECHO CLIC EN EL JTABLE PACIENTES SELECCIONANDO UN REGISTRO 
    int i=jTablePacientes.getSelectedRow();
    if(i==-1)
                {
                  JOptionPane.showMessageDialog(jTablePacientes,"Porfavor Elija Un Registro"); 
                }else
                    {
                    GenerarReporte reportito = new GenerarReporte();
                    //***********BUSCANDO SI EL PACIENTE TIENE ALGUNA ATENCION****************************
                        try{
                            ConexionBD conectar = new ConexionBD();
                            Connection cn = conectar.conexion();
                            sent = cn.createStatement();
                            int x=Integer.parseInt(TxtConsulta.getText());
                            //System.out.println(x);
                            reportito.reporteproce(x);
                            resultado.close();
                            sent.close();
                            }catch(Exception e)
                                {
                                System.err.println(""+e.getMessage());
                                }
                }

and so I get in the netbeans .. but already in the application I get that error

Please give me a hand that I'm stuck with

that's how I get it in the application

and this is what the log booted me

    
asked by AyakDrg 24.04.2018 в 23:27
source

1 answer

0

I solved the problem, apparently it was some compatibility problem with netbeans 8.2 and jdk what I did was download an executable file from the Oracol page that had the netbenas and the jdk included! .. with that I already the report came out greetings!

    
answered by 29.04.2018 в 16:27