3
I made a small program in java to generate budget reports, I used for both Jasper Ireport, made, tested, generated the budgets all running on my computer. When I installed it on a friend’s computer it worked all right except the reports, it doesn’t even appear blank, it looks like this:
In the code, the image path, it seems, is set correctly.
public void imprimeRelatorio() {
ConexaoMySql co = new ConexaoMySql();
co.setUrl("jdbc:mysql://localhost:3306/poc");
co.setUsuario("root");
co.setSenha("");
String src = "C:\\orcamento.jasper";
Map<String, Object> parametros = new HashMap<String, Object>();
parametros.put("id",(Integer.parseInt(inpId.getText())));
System.out.println("parametros="+parametros);
JasperPrint jasperPrint = null;
try {
jasperPrint = JasperFillManager.fillReport(src, parametros, co.getConnection());
} catch (JRException ex) {
Logger.getLogger(TelaControle.class.getName()).log(Level.SEVERE, null, ex);
}
JasperViewer view = new JasperViewer(jasperPrint, false);
view.setVisible(true);
System.out.println("view" +view);
}
I ran by cmd to see the output and actually the image path seems to be correct.
The strange thing is that my computer works normally.