Ver Mensaje Individual
  #1 (permalink)  
Antiguo 01/04/2013, 14:17
Geovanny0401
 
Fecha de Ingreso: diciembre-2009
Mensajes: 137
Antigüedad: 14 años, 4 meses
Puntos: 4
Pregunta Problema con JasperReport

buenas amigo del foro, estoy tratando de realizar un reporte java con mysql y jasperReport cuando trato de imprimir el reporte me genera un error

Código PHP:
net.sf.jasperreport.egine.JRExceptionReporteFactura.jasper 
lo estuve analizando en la letra de color me muestra que no carga el reporte detoda manera adjunto el sgte codigo

String template="ReporteFactura.jasper";
JasperReport reporte=(JasperReport) JRLoader.loadObject(template);


la clase del reporte

Código PHP:
package beans
import java.sql.*; 
import java.util.HashMap
import java.util.Map
import net.sf.jasperreports.view.JRViewer.*; 
import net.sf.jasperreports.engine.*; 
import net.sf.jasperreports.engine.util.JRLoader
import net.sf.jasperreports.view.*; 
import net.sf.jasperreports.view.save.JRPdfSaveContributor.*; 
import net.sf.jasperreports.view.JRViewer.*; 
import net.sf.jasperreports.view.save.JRMultipleSheetsXlsSaveContributor.*; 
import java.util.logging.Level
import java.util.logging.Logger
import javax.swing.JOptionPane

/** 
 * 
 * @author GEOVANY 
 */ 
public class IniciarReporte 
        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 CONEXION
public 
void EjecutarReporte(int Facturathrows ClassNotFoundExceptionSQLException
     


    try 
    { 
            Class.
forName(DRIVER); 
            
CONEXION DriverManager.getConnection(RUTA,USER,PASSWORD); 
            
javax.swing.JOptionPane.showMessageDialog(null,"Conexion establecida");
             
String template="ReporteFactura.jasper"
            
JasperReport reporte=(JasperReportJRLoader.loadObject(template); 


            
Map param=new HashMap(); 

            
param.put("NUM_FACTURA"Factura); 
            
JasperPrint jasperprintJasperFillManager.fillReport(reporte,param,CONEXION);
             
JasperViewer visor=new JasperViewer(jasperprint,false); 
            
visor.setTitle("Geniz Reportes - GSF"); 
            
visor.setVisible(true); 
    } 
    catch(
Exception j
    { 
           
JOptionPane.showMessageDialog(null"Problemas al generar el reporte. \n Detalles: " j);
            
Logger.getLogger(IniciarReporte.class.getName()).log(Level.SEVEREnullj);
     } 


el botón imprimir

Código PHP:
private void cmdGenerarActionPerformed(java.awt.event.ActionEvent evt) {                                           
         
// TODO add your handling code here: 
       
try 
       { 
           
int id=Integer.parseInt(txtReporte.getText()); 
        
report.EjecutarReporte(id); 

       } catch (
ClassNotFoundException ex) { 
            
Logger.getLogger(ReporteFactura.class.getName()).log(Level.SEVEREnullex);
         } catch (
SQLException ex) { 
            
Logger.getLogger(ReporteFactura.class.getName()).log(Level.SEVEREnullex);
         } 
    }