我在这里做错了什么?
private void jButton2ActionPerformed(java.awt.event.ActionEvent evt) {
subreport_dir = "...\\Report\\subReport.jasper";
try {
compileView("...\\Report\\myReport.jrxml");
} catch (JRException ex) {
JOptionPane.showMessageDialog(this, "No Row");
System.out.println(ex.toString());
}
}
当我调用函数
时private static void compileView(String path) throws JRException {
Map<String, Object> param = new HashMap<String, Object>();
param.put("month", myMonth);
param.put("year", myYear);
param.put("SUBREPORT_DIR", subreport_dir);
param.putAll(param);
JasperReport jRp = JasperCompileManager.compileReport(path);
JasperPrint jPrint = JasperFillManager.fillReport(jRp, param, getConnection());
JasperViewer.viewReport(jPrint, false);
JasperViewer.setDefaultLookAndFeelDecorated(true);
}
我得到了这个例外:
线程中的异常&#34; AWT-EventQueue-0&#34; java.lang.NoClassDefFoundError:net / sf / jasperreports / compilers / GroovyEvaluator
我该怎么办?
答案 0 :(得分:0)
在<jasperReport>
标记
<jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="subreport" language="groovy" pageWidth="555" pageHeight="842" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="6afeba62-b470-4dfb-a8fb-42e2226b906d">
<强>语言=&#34;常规&#34; 强>
到
语言=&#34; java&#34;