hell_tej Posted March 10, 2009 Share Posted March 10, 2009 my Desktop Application is based on NetBeans 6.0 and i use iReport to display Report.It works Properly on my Computer but when i run jar file on another computer(Customer Computer), Report can't run!so what's th problem? shell i add any type of Library or other supported file to run iReport on user computer.i am giving you my code which is used to display report from my Swing Menu. Code:try { String reportName = "universaljobforce/candidate.jasper"; InputStream is = this.getClass().getClassLoader().getResourceAsStream(reportName); JasperPrint jasperPrint = JasperFillManager.fillReport(is, new HashMap(), DB.connect()); JasperViewer jv = new JasperViewer(jasperPrint); jv.setVisible(true); } catch(Exception e) { System.out.println("Report Error"+e); } Link to comment Share on other sites More sharing options...
svenn Posted March 10, 2009 Share Posted March 10, 2009 If your Java code is running on the customers computer the Jasper Report jar must be accessible from the customers computer. Link to comment Share on other sites More sharing options...
hell_tej Posted March 10, 2009 Author Share Posted March 10, 2009 my NetBeans Jar file which holds the report .jasper files can't work i Think it cause of that computer has only JDK 6.0 it has no other iReport Plugin or iReport Software so without it's supported file it can't run. am i right or not? What's the solution of it please Help!!! Link to comment Share on other sites More sharing options...
svenn Posted March 10, 2009 Share Posted March 10, 2009 First iReport is a development tool. Jasper Report is the reporting engine. For Jasper Report to run you need to include the Jasper Report jar as part of your deployment.It is located in the lib that comes with iReports and is in the formjasperreports-#.#.#.jarwhere # are the version numbers Link to comment Share on other sites More sharing options...
hell_tej Posted March 12, 2009 Author Share Posted March 12, 2009 I Include Following Library jar files 1).jasperreports-3.1.3.jar 2).jasperreports-chart-themes-3.1.2.jar 3).commons-beanutils-1.7.jar 4).commons-collections-2.1.jar 5).commons-digester-1.7.jar 6).commons-logging-1.1.jar 7).iText-2.1.0.jar but still that problem, when i run my Swing desktop application on another computer,Report can't visible when i click on swing Button of Report. Link to comment Share on other sites More sharing options...
hell_tej Posted April 7, 2009 Author Share Posted April 7, 2009 Please Solve my problem i have to submit my project after 5 days to my examinar. still i have problem that i can't run by Jasper Report in other computer. my whole NetBeans Project runs properly but when i click on button of report it displays NullPointerException. in my computer it works properly. please Help... Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted April 7, 2009 Share Posted April 7, 2009 jasperreports.jar is not enough, you need many other jars from which JR depends to.I suggest you to download the jasperreports distribution for the exact set of jars you need.Probably in some way you have these jars in the classpath on your local machine...Anyway can you see an exception or something?Giulio Link to comment Share on other sites More sharing options...
hell_tej Posted April 8, 2009 Author Share Posted April 8, 2009 Thanks Mr. Giulio Toffoli for Reply, I tried your suggestions in my project. I include following JAR file library in my NetBeans Project. (1).commons-beanutils-1.7.jar (2).commons-collections-2.1.jar (3).commons-digester-1.7.jar (4).commons-logging-1.1.jar (5).groovy-all-1.5.5.jar (6).jakarta-bcel-20050813.jar (7).jaxen-1.1.1.jar (8).jcommon-1.0.15.jar (9).jfreechart-1.0.12.jar (10). jpa.jar (11). hxl-1.6.jar (12).png-encoder-1.5.jar (13).poi-3.2-FINAL-20081019.jar (14). jasperreports-3.1.3.jar (15). xalan.jar (16). xercesImpl.jar (17). xml-apis.jar (18). batik-anim.jar (19).batik-awt-util.jar (20).batik-bridge.jar (21). batik-css.jar (22) batik-dom.jar (23). batik-ext.jar (24). batik-gvt.jar (25). batik-parser.jar (26). batik-script.jar (27). batik-svg-dom.jar (28).batik-svggen.jar (29). batik-util.jar (30). batik-xml.jar (31).iText.jar (32).rhino-1.7R1.jar (33).xml-apis-ext.jar (34).jasperreports-chart-themes-3.1.2.jar I am creating a JobPlacement Swing Based Desktop Application which has 4 tables. I was created reports for each table using iReport Plugin of NetBeans 6.0. then I create a setup file using InstallShild 2009. It works excellent when I install setup on My computer , when I was install that project on other computer and run project’s .jar. My Swing Based Application runs fine but only the Report Occurs problem when I tried to load it. I also tried to install iReport Software .exe file on that computer but still it not works.Is JasperServer or something needed. Or if any other JAR or API needed to run my report on another computer Platform :- Windows XPDatabase:- MS Access 2003 IDE :-NetBeans 6.0App. :- JAVA Swing Desktop Applicationi use following code to view report.Code:try { String reportName = "universaljobforce/candidate.jasper"; InputStream is = this.getClass().getClassLoader().getResourceAsStream(reportName); JasperPrint jasperPrint = JasperFillManager.fillReport(is, new HashMap(), DB.connect()); JasperViewer jv = new JasperViewer(jasperPrint); jv.setVisible(true); } catch(Exception e) { System.out.println("Report Error"+e); } Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted April 8, 2009 Share Posted April 8, 2009 The jasper file you produce must use the same JasperReports version of your application. I.e. if you compile a report with iReport 3.5.0 (which comes with JasperReport 3.5.0), you can not use this jasper file with JasperReports 3.1.2 (that's the one shipped with your application).You can still use a jasper file produced with an old version of JasperReports with a newer version of the library since the backward compatibility is assured.Giulio Link to comment Share on other sites More sharing options...
hell_tej Posted April 9, 2009 Author Share Posted April 9, 2009 Sorry Mr. Giulio, But it still have problem. I checked all librarys and replace them to iReport plugin verson's library in which report created. But still when i install it on other computer,it returns NullPointerException. what can i do for it Please please please please please please please HELP ME......................My examinar will check my project after two days Post Edited by Tejas Sheth at 04/09/09 14:23 Link to comment Share on other sites More sharing options...
Giulio Toffoli Posted April 9, 2009 Share Posted April 9, 2009 Try asking on the NetBeans forum (RCP platform development), or find the guy that fixed the problem in NetBeans.I don't know how better help you.Good luckGiulio Link to comment Share on other sites More sharing options...
nishrin_naya Posted March 12, 2015 Share Posted March 12, 2015 Hello ,My project also suffer from same problem,I can view my report on one computer but can't view report on other system.Project working well on other system but reports not working.Please help me how you solve your problem.Thank you in Advance Link to comment Share on other sites More sharing options...
nishrin_naya Posted March 14, 2015 Share Posted March 14, 2015 Hello, my Desktop Application is based on NetBeans 7.0 and i use iReport to display Report. It works Properly on my Computer but when i run jar file on another computer(Customer Computer), Report can't run! so what's the problem? shell i add any type of Library or other supported file to run iReport on user computer.i am giving you my code which is used to display report from my Swing Menu. Please help me. Link to comment Share on other sites More sharing options...
hima4rill Posted January 5, 2016 Share Posted January 5, 2016 Please help me sir, I'm working on standalone java application with Jasper as a reporting tool. Everything work on my system but the report are not opening on other system. I included all the necessary library . below is my method to perform the operation public void viewStudent(String sex, String classes) { try { String url = "jdbc:mysql://localhost/sis"; String username = "root"; String password = "hima"; Connection con = DriverManager.getConnection(url,username,password); Statement stmt = con.createStatement(); try { JasperDesign jd = JRXmlLoader.load("C:\Users\HASHIM A.S\Documents\viewstudents.jrxml"); String Query = "SELECT id,sname,fname,mname,sex,class,gname,gphone from student_info where sex = '"+sex+"' AND class = '"+classes+"' ORDER BY id "; JRDesignQuery newQueery = new JRDesignQuery(); newQueery.setText(Query); jd.setQuery(newQueery); JasperReport jr = JasperCompileManager.compileReport(jd); JasperPrint jp = JasperFillManager.fillReport(jr, null, con); JasperViewer.viewReport(jp,false); } catch (JRException ex) { Logger.getLogger(RegisterationPage.class.getName()).log(Level.SEVERE, null, ex); } } catch (SQLException ex) { Logger.getLogger(RegisterationPage.class.getName()).log(Level.SEVERE, null, ex); } } Link to comment Share on other sites More sharing options...
hima4rill Posted January 5, 2016 Share Posted January 5, 2016 Please help me sir, I'm working on standalone java application with Jasper as a reporting tool.Everything work on my system but the report are not opening on other system. I included all the necessary library . below is my method to perform the operationpublic void viewStudent(String sex, String classes) { try { String url = "jdbc:mysql://localhost/sis"; String username = "root"; String password = "hima"; Connection con = DriverManager.getConnection(url,username,password); Statement stmt = con.createStatement(); try { JasperDesign jd = JRXmlLoader.load("C:\Users\HASHIM A.S\Documents\viewstudents.jrxml"); String Query = "SELECT id,sname,fname,mname,sex,class,gname,gphone from student_info where sex = '"+sex+"' AND class = '"+classes+"' ORDER BY id "; JRDesignQuery newQueery = new JRDesignQuery(); newQueery.setText(Query); jd.setQuery(newQueery); JasperReport jr = JasperCompileManager.compileReport(jd); JasperPrint jp = JasperFillManager.fillReport(jr, null, con); JasperViewer.viewReport(jp,false); } catch (JRException ex) { Logger.getLogger(RegisterationPage.class.getName()).log(Level.SEVERE, null, ex); } } catch (SQLException ex) { Logger.getLogger(RegisterationPage.class.getName()).log(Level.SEVERE, null, ex); } } Link to comment Share on other sites More sharing options...
chandrasekhargeceindia.co Posted January 20, 2016 Share Posted January 20, 2016 hi ,still im facing the same problem.if anyone solved this please let me know.thanks and regardschandrashekhar Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now