0

I'm trying run a report and I'm very sure that the file is there but still getting this message I try changing directory outside the package inside everywhere. I'm using a Mac(ios).

This the error

java.io.FileNotFoundException: \Users\jeffyarias\NetBeansProjects\LOAN\src\reporte\cliente.jrxml (No such file or directory) BUILD SUCCESSFUL (total time: 10 seconds)

.

try{
    Class.forName("org.gjt.mm.mysql.Driver");
    Connection con = DriverManager.getConnection("jdbc:mysql://127.0.0.1/Loan", "root", null);
    String reportpath="\\Users\\jeffyarias\\NetBeansProjects\\LOAN\\src\\reporte\\cliente.jrxml";
   JasperReport jr= JasperCompileManager.compileReport(reportpath);
   JasperPrint jp= JasperFillManager.fillReport(jr, null, con);
   JasperViewer.viewReport(jp);
   con.close();
}
catch (Exception ex){
    System.out.println(ex.getMessage());
}
Petter Friberg
  • 21,252
  • 9
  • 60
  • 109
Jeff Arias
  • 17
  • 1
  • 8

1 Answers1

0

You using Mac(ios) try to write the path like this:

 /Users/jeffyarias/NetBeansProjects/LOAN/src/reporte/cliente.jrxml
Abdelhak
  • 8,299
  • 4
  • 22
  • 36