Prezados ,
Estou com um probleminha , bem, tenho uns relatorios que funcionam normalmente dentro do netbeans ! entretanto quando eu construo o arquivo e ele gera o .jar o relatorio nao aparece , eu clico no butao e nada aparece !
To pegando FILE NOT FOUND , onde eu coloco o .jasper ??
t’a no meu classpath
Eis minha classe
/*
- To change this template, choose Tools | Templates
- and open the template in the editor.
*/
package blokretam;
import java.sql.Connection;
import java.sql.DriverManager;
import java.sql.SQLException;
import java.util.HashMap;
import net.sf.jasperreports.engine.<em>;
import net.sf.jasperreports.engine.util.JRLoader;
import net.sf.jasperreports.view.</em>;
import net.sf.jasperreports.engine.xml.JRXmlLoader;
import net.sf.jasperreports.engine.design.JasperDesign;
import javax.swing.* ;
/**
*
-
@author lestat */ public class ChamaRelatorio { private static Connection getConnection() throws ClassNotFoundException, SQLException { String driver = “com.mysql.jdbc.Driver”; String url = “jdbc:mysql://localhost:3306/blokretam”; String user = “root”; String password = “senha”;
Class.forName(driver); Connection con = DriverManager.getConnection(url, user, password); return con;
}
public static void main(String[] args) throws JRException, Exception {
}
public void geraRelatorio( String s ) throws JRException, SQLException, ClassNotFoundException { try { HashMap map = new HashMap(); JasperReport jasperReport = (JasperReport) JRLoader.loadObject(s); JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, map,ChamaRelatorio.getConnection()); JasperViewer jrviewer = new JasperViewer(jasperPrint, true); jrviewer.setVisible(true); } catch (Exception e) { JOptionPane.showMessageDialog(null, e); } }
}