Ola moçada em geral,
estou com problemas neste codigo:
public class JasperReportExample {
private static final String url = "jdbc:oracle:thin:@host:1521:cid";
private static final String driver = "oracle.jdbc.driver.OracleDriver";
private static final String login = "user";
private static final String pwd = "pass";
public JasperReportExample() {
}
public void gerar( String layout ) throws JRException , SQLException, ClassNotFoundException {
//gerando o jasper design
JasperDesign desenho = JRXmlLoader.load( layout );
//compila o relatório
JasperReport relatorio = JasperCompileManager.compileReport( desenho );
//estabelece conexão
Class.forName( driver );
Connection con = DriverManager.getConnection( url , login , pwd );
Statement stm = con.createStatement();
String query = "select * from chamado";
ResultSet rs = stm.executeQuery( query );
//implementação da interface JRDataSource para DataSource ResultSet
JRResultSetDataSource jrRS = new JRResultSetDataSource( rs );
//executa o relatório
Map parametros = new HashMap();
parametros.put("id_chamado", new Double(10));
JasperPrint impressao = JasperFillManager.fillReport( relatorio , parametros, jrRS );
//exibe o resultado
JasperViewer viewer = new JasperViewer( impressao , true );
viewer.viewReport(impressao);
}
public static void main(String[] args) {
try {
new JasperReportExample().gerar( "./relatorios/relatorio_chamado.jrxml" );
} catch (Exception e) {
e.printStackTrace();
}
}
}
Ele retorna o erro: java.io.FileNotFoundException: .\relatorios\relatorio_chamado.jrxml (O sistema não pode encontrar o caminho especificado)