JRViewer / JasperViewer is not showing when i run the jar file.

Hello.. i am still a newbie in using jasper report. Now, i am trying to create a report with iReport using netbeans. when i try to run the program from netbeans, there is nothing wrong with the report and the jasper viewer is showed up. but after i clean and build the program and try to run it from the jar file, the viewer is not showing. i already try to use JRviewer and add it to a jFrame but still nothing showed up. 

this is the list of the library i am using :

- Oracle jdbc 11.jar

- Groovy 3.0.6. jar

- Common Digester 2.1 .jar

- Commons Logging 1.2 .jar

- Commons Bean Utils 1.9.4 jar

- Commons JavaFlow 1209105.jar

- Commons Collections 4 - 4.4 .jar

- POI 3.15 .jar

- Jasper Reports 6.19.0 .jar

- JDK 15

and i am using ireport plugin version 4.8.0.nbm

i already try using InputStream / file and it still not working

            clsDBSConnection conn= new clsDBSConnection(); 
            conn.openConnection();


            InputStream st = getClass().getResourceAsStream("/XB/Reports/irpAgingStock_1.jrxml");
            JasperDesign jd = JRXmlLoader.load(st);     
            JasperReport jrp = JasperCompileManager.compileReport(jd);          
            HashMap hash = new HashMap();
            JasperPrint jprint = JasperFillManager.fillReport(jrp, hash, conn.getConnection());
            
            JasperViewer jView = new JasperViewer(jprint);
            jView.setVisible(true);

and i am already try to check if the jasper print is null or not using this :

          if(jprint.getPages().isEmpty()){
               JOptionPane.showMessageDialog(null, 
                "No Data", 
                "Warning", 
                JOptionPane.ERROR_MESSAGE);

            }else{
                JasperViewer.viewReport(jprint, false);                
            }

and still nothing is showed up. and there is no error at all.

but there is some warning like this 

but the report can run normally when compiled from netbeans.

and if there is something wrong with the combination of library. can you suggest me about the library combination,  what library should i use and what version?

Anyone can help me?
 

Thanks a lot, Hans

hanschristiansemitro's picture
Joined: Oct 27 2022 - 8:04pm
Last seen: 20 min 48 sec ago

Use jasper report 5.6.0 jar file 
OR
You can compile reports in JaspersoftStudio 6.19.0 version

NB: Netbeans compile support jasper 5.6.0 library 

mahadiosb - 5 days 7 hours ago

0 Answers:

No answers yet
Feedback
randomness