shravanpal890 Posted June 17, 2017 Share Posted June 17, 2017 i;m new on jasper report sir i was faced problem generating the jasper report from the executable jar file but when i used in my eclipse ide it was still work here is my codepublic void showReport(ActionEvent event) throws JRException, ClassNotFoundException, SQLException { Attendence gtm=(Attendence)list.getSelectionModel().getSelectedItem(); if(gtm.getRegNum() !=null){ String reg_id=gtm.getRegNum(); String testId=gtm.getDilId(); String reportSrcFile = "report/Blank_A4.jrxml"; HashMap<String, Object> parameters = new HashMap<String, Object>(); if(testId.contains("Dil")); { parameters.put("dil_teest", testId); } parameters.put("test", reg_id); ArrayList<HashMap<String, Object>> list = new ArrayList<HashMap<String, Object>>(); list.add(parameters); JRBeanCollectionDataSource beanColDataSource = new JRBeanCollectionDataSource(list); JasperReport jasperReport = JasperCompileManager.compileReport(reportSrcFile); JasperPrint print = JasperFillManager.fillReport(jasperReport, parameters,con); JRViewer viewer = new JRViewer(print); viewer.setOpaque(true); viewer.setVisible(true); this.add(viewer); this.setSize(700, 500); this.setVisible(true); } Link to comment Share on other sites More sharing options...
hozawa Posted June 18, 2017 Share Posted June 18, 2017 You haven't provided us any error message nor your jrxml file.The most probably reason why your report works in eclipse and not in your executable is because you're missing a jar file. 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