File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/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


Win a copy of Android Security Essentials Live Lessons this week in the Android forum!
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: 38045
    
  22
Sounds like an IDE-related question. Moving.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: how to add a .jrxml file in netbean project and call it
 
Similar Threads
Help me with the calling of jasper reports through java code
jasperreports does not work in executable jar file
jasper reports
Jasper report error
Error: getOutputStream() has already been called for this reponse