Ver Mensaje Individual
  #3 (permalink)  
Antiguo 03/05/2013, 14:21
Geovanny0401
 
Fecha de Ingreso: diciembre-2009
Mensajes: 137
Antigüedad: 14 años, 4 meses
Puntos: 4
Respuesta: El documento no tiene pagina

Mira lo que hice amigo
Código PHP:
public class EjecutarReporte {
  
// Connection con;
//agregue esto
 
public static final String DRIVER="com.mysql.jdbc.Driver";
       public static final 
String RUTA="jdbc:mysql://localhost/factura";
       public static final 
String USER="root";
       public static final 
String PASSWORD="root";
       public static 
Connection con;
//Connection con;

    
public void startReport(int factura){
         
        try{
//Agregue tambien esto
            
Class.forName(DRIVER);
            
con DriverManager.getConnection(RUTA,USER,PASSWORD);
            
javax.swing.JOptionPane.showMessageDialog(null,"Conexion establecida");
           
//direccion del archivo JASPER
            
String in="reportefactura.jasper";

            
//URL  in = this.getClass().getResource("reportefactura.jasper");
            
if (in == null) {
                  throw new 
Exception("No encuentro el archivo del reporte maestro.");
                  }
            
JasperReport reporte =null;
            try {
                     
reporte = (JasperReportJRLoader.loadObjectin );

             } catch (
Exception e) {
                     throw new 
Exception("Error cargando el reporte : " e.getMessage());
             }

             
//reporte=(JasperReport) JRLoader.loadObject(template);

           // Map param=new HashMap();
            //Se crea un objeto HashMap
            
Map param = new HashMap();
            
param.clear();
            
param.put("FACTURA"factura);
            
//Conexion con = new Conexion();
            //con.connect("", "");
             
JasperPrint jasperprint null;
                try {
                    
jasperprint JasperFillManager.fillReport(reporte,param,con);
                    
//JasperPrintManager.printReport(jasperprint, true);
                    
jasperprint.setOrientation(JasperReport.PRINT_ORDER_VERTICAL);
                } catch (
JRException e) {
                        throw new 
Exception("Error llenando el reporte maestro: " e.getMessage());
                        }
              try {
                        
JasperViewer visor=new JasperViewer(jasperprint,false);
                        
visor.setTitle("GMMG Reportes - YCCE");
                        
visor.setVisible(true);
                } catch (
Exception e) {
                        throw new 
Exception("Error visualizando el reporte : " e.getMessage());
                }                     
        }catch(
Exception e){
            
javax.swing.JOptionPane.showMessageDialog(nulle);

        }
    }

y ahora me sale este error
Código PHP:
java.lang.nullpointerexception 

Última edición por Geovanny0401; 03/05/2013 a las 14:46