Win a copy of Succeeding with AI this week in the Artificial Intelligence and Machine Learning forum!
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Paul Clapham
  • Ron McLeod
  • Liutauras Vilda
  • Junilu Lacar
Sheriffs:
  • Tim Cooke
  • Jeanne Boyarsky
  • Knute Snortum
Saloon Keepers:
  • Stephan van Hulst
  • Tim Moores
  • Tim Holloway
  • Carey Brown
  • Piet Souris
Bartenders:
  • salvin francis
  • fred rosenberger
  • Frits Walraven

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

 
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?
 
Marshal
Posts: 69035
275
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Sounds like an IDE-related question. Moving.
 
He's giving us the slip! Quick! Grab this tiny ad!
Thread Boost feature
https://coderanch.com/t/674455/Thread-Boost-feature
    Bookmark Topic Watch Topic
  • New Topic