Jump to content
Changes to the Jaspersoft community edition download ×

jasperreports-6.5.1 Open template already created


jgddantas2

Recommended Posts

2166/5000

Hi, I'm just trying to get the template ready in Jasper Design studio and call it by the java application.
I'm using: jasperreports-6.5.1 in eclipse Neon.3 Release (4.6.3).
lbs:
jasperreports-6.5.1.jar
jasperreports-fonts-6.5.1.jar
jasperreports-javaflow-6.5.1.jar

With the java code like this:

public static void CallRelatorioPDF1(){
                try {
                    Connection connection  = ConexaoUtil.getInstance().getConnection();
                    path ="src/MyiReport/rel/lista_prod_1_A4.jasper";
                    
                    String object = "lista_prod_1_A4";
                    JasperPrint print = JasperFillManager.fillReport(path, null, connection);
                    JasperViewer viewer = new JasperViewer(print,false);
                    viewer.setVisible(true);
                    viewer.setExtendedState(Frame.MAXIMIZED_BOTH);
                    //viewer.setTitle(title);
                    try {
                        connection.close();
                    } catch (Exception ex) {
                        // TODO: handle exception
                        JOptionPane.showMessageDialog(null, ex.getCause());
                    }
                        
                    
                } catch (Exception e) {
                    // TODO: handle exception
                    JOptionPane.showMessageDialog(null, e.getMessage());
                }
                
            }

When running ... I have the following error:

Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/apache/commons/logging/LogFactory
    at net.sf.jasperreports.engine.util.JRLoader.<clinit>(JRLoader.java:81)
    at net.sf.jasperreports.engine.JRPropertiesUtil.loadProperties(JRPropertiesUtil.java:102)
    at net.sf.jasperreports.engine.DefaultJasperReportsContext.initProperties(DefaultJasperReportsContext.java:108)
    at net.sf.jasperreports.engine.DefaultJasperReportsContext.<init>(DefaultJasperReportsContext.java:85)
    at net.sf.jasperreports.engine.DefaultJasperReportsContext.<clinit>(DefaultJasperReportsContext.java:68)
    at net.sf.jasperreports.engine.JasperFillManager.getDefaultInstance(JasperFillManager.java:87)
    at net.sf.jasperreports.engine.JasperFillManager.fillReport(JasperFillManager.java:759)
    at br.com.monteb.fiscal.FrmPrincipal.CallRelatorioPDF1(FrmPrincipal.java:6626)
    at br.com.monteb.fiscal.FrmPrincipal$13.actionPerformed(FrmPrincipal.java:1282)

.....

Could Algume guide me how to solve the error?
Is there any lib to use this version?

Thank you for your help.

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Popular Days

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...