Hello! I have compiled my
java application done using Netbeans and it generated a .jar file.
My application is able to load the jasper reports if i compile and run it in my local machine.
However, if i distribute my application to another machine, the jasper report cannot be loaded and returns jrexceptions: java.io.filenotfoundexception: c:/reports/reportInvestment.jasper
my code is this using the
code:
Class.forName("com.mysql.jdbc.Driver");
//set generic location
String jasperLocation = String.valueOf(getClass().getResource("/report/reportInvestment.jasper")).substring(5);
javax.swing.JOptionPane.showMessageDialog(null, jasperLocation);
net.sf.jasperreports.engine.JasperPrint jasperPrint = net.sf.jasperreports.engine.JasperFillManager.fillReport(jasperLocation, hashMap, connection);
net.sf.jasperreports.engine.
}