aspose file tools*
The moose likes IDEs, Version Control and other tools and the fly likes how to add a .jrxml file in netbean project and call it Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Engineering » IDEs, Version Control and other tools
Bookmark "how to add a .jrxml file in netbean project and call it" Watch "how to add a .jrxml file in netbean project and call it" New topic
Author

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

Dhanushka Nayanananda
Greenhorn

Joined: Jan 16, 2011
Posts: 14
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

Joined: Oct 13, 2005
Posts: 38818
    
  23
Sounds like an IDE-related question. Moving.
 
With a little knowledge, a cast iron skillet is non-stick and lasts a lifetime.
 
subject: how to add a .jrxml file in netbean project and call it