在使用DynamicReport和Jasperreports的项目中,使用以下代码:
JasperReportBuilder jasperReportBuilderSubreport = generateSubReport(...);
...
JasperReport jasperReport = jasperReportBuilderSubreport.toJasperReport(); //Exception line
执行会抛出异常:
java.lang.NoSuchMethodError:
net.sf.jasperreports.engine.design.JasperDesign.setOrientation(Lnet/sf/jasperreports/engine/type/OrientationEnum;)V
at net.sf.dynamicreports.jasper.transformation.ReportTransform.page(ReportTransform.java:220)
...
pom.xml:
...
<dependency>
<groupId>net.sf.jasperreports</groupId>
<artifactId>jasperreports</artifactId>
<version>4.5.1</version>
</dependency>
..
<dependency>
<groupId>net.sourceforge.dynamicreports</groupId>
<artifactId>dynamicreports-core</artifactId>
<version>2.5.1</version>
</dependency>
...
你知道哪个是问题吗?感谢