My project has the following architecture :
My template is "report1.jrxml", then when i excute this code :
TableModel model = (TableModel) masterTable.getModel();
JRTableModelDataSource data = new JRTableModelDataSource(model);
String reportSource ="report1.jrxml";
try {
JasperReport jr = JasperCompileManager.compileReport(reportSource);
JasperPrint jp = JasperFillManager.fillReport(jr, null,data);
} catch (JRException ex)
{
Logger.getLogger(master.class.getName()).log(Level.SEVERE, null, ex);
}
I get this error(I'm sorry for the french language, but is quite understandable :p):
Grave: null
net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: report1.jrxml (Le fichier spécifié est introuvable)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:176)
at net.sf.jasperreports.engine.xml.JRXmlLoader.load(JRXmlLoader.java:156)
at net.sf.jasperreports.engine.JasperCompileManager.compile(JasperCompileManager.java:171)
at net.sf.jasperreports.engine.JasperCompileManager.compileReport(JasperCompileManager.java:448)
at testjasper.master.jButton1ActionPerformed(master.java:319)
at testjasper.master.access$900(master.java:25)
at testjasper.master$FormListener.actionPerformed(master.java:259)
Netbeans says that the file can't be found , but as you can see in the screenshot, its exists ?
How can I solve this "problem" ?
rather, what's the problem ?
My regards. :p
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…