• Post Reply
  • Bookmark Topic Watch Topic
  • New Topic

how to add a .jrxml file in netbean project and call it

 
Dhanushka Nayanananda
Greenhorn
Posts: 14
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I want to include the .jrxml file in my netbeans swing project.I use netbeans 7.0.1. I created a package inside source package called "rep" and created a simple .jrxml file called "rp.jrxml". I have installed the iReport plugin in netbeans. When I set a outer .jrxml file,it is showed("D:/MyReports/firstreport.jrxml") but when I set the netbean package path,it wasnot showed.Here is my code.
try {
String reportSource="/rep/rp.jrxml"; //and also "rep/rp.jrxml" is used.no result.
Map<String, Object> params = new HashMap<String, Object>();
JasperReport jasperReport = JasperCompileManager.compileReport(reportSource);
JasperPrint jasperPrint = JasperFillManager.fillReport(jasperReport, params, new JREmptyDataSource());
JasperViewer.viewReport(jasperPrint, false);
} catch (Exception e) {e.printStackTrace();
}

Then the following error is given;

net.sf.jasperreports.engine.JRException: java.io.FileNotFoundException: rep\rp.jrxml (The system cannot find the path specified)

How I can keep jrxml files inside my netbeans project and use jrxml files inside the project?
 
Campbell Ritchie
Sheriff
Pie
Posts: 50175
79
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like an IDE-related question. Moving.
 
  • Post Reply
  • Bookmark Topic Watch Topic
  • New Topic