jasper reports does not work in executable jar file

0

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 code

public 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);
   }
shravanpal890's picture
Joined: Jan 30 2017 - 5:20am
Last seen: 2 months 1 day ago

1 Answer:

0

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.

hozawa's picture
13751
Joined: Apr 24 2010 - 4:31pm
Last seen: 1 day 10 hours ago
Feedback
randomness