Jump to content
Changes to the Jaspersoft community edition download ×

jasper reports does not work in executable jar file


shravanpal890

Recommended Posts

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);
   }
Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

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 account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...