1
我有點新的碧玉報告,我想打電話給我已經創建和編輯了的.jrxml但我越來越想讀的.jrxml Exception in thread "AWT-EventQueue-0" java.lang.NoClassDefFoundError: org/codehaus/groovy/control/CompilationFailedException
Jasper報表導出PDF的Java
這裏是我的代碼:
private void saveAsMenuItemActionPerformed(java.awt.event.ActionEvent evt) {
JasperPrint jp;
JasperReport jr;
try {
Connection con=DriverManager.getConnection("jdbc:derby://localhost:1527/Database", "user", "password");
jr=JasperCompileManager.compileReport("Reports/Cierre de Caja.jrxml");
jp=JasperFillManager.fillReport("Reports/Cierre de Caja.jasper", new HashMap(), con);
System.out.println("got jasper");
JasperViewer jv=new JasperViewer(jp);
jv.setVisible(true);
}
catch (JRException e){
System.out.println("Jasper: "+e.getLocalizedMessage());
}
catch (SQLException e){
System.out.println("SQL: "+e.getLocalizedMessage());
}
}
你的項目需要另一種依賴......檢查[這裏](HTTP:/ /stackoverflow.com/questions/11 773702/why-do-i-get-exception-java-lang-noclassdeffounderror-org-codehaus-groovy) – Dazak
可愛的,這工作如此順利。 –