3

I am trying to generate a jasper report using a tabledatamodel, as

JRDataSource dataSource = new JRTableModelDataSource(model);
JasperPrint jp = DynamicJasperHelper.generateJasperPrint(dr, new ClassicLayoutManager(), dataSource);


        JasperViewer.viewReport(jp);

when I run this code I get following error, if anyone can help me to come-up with this problem.

Exception in thread "main" java.lang.NoSuchMethodError: ar.com.fdvs.dj.domain.DynamicJasperDesign.setPrintOrder(B)V at ar.com.fdvs.dj.core.DJJRDesignHelper.getNewDesign(DJJRDesignHelper.java:69) at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperDesign(DynamicJasperHelper.java:207) at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperReport(DynamicJasperHelper.java:535) at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperReport(DynamicJasperHelper.java:518) at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperPrint(DynamicJasperHelper.java:283) at ar.com.fdvs.dj.core.DynamicJasperHelper.generateJasperPrint(DynamicJasperHelper.java:236)

Harsha
  • 3,548
  • 20
  • 52
  • 75

2 Answers2

5

This has something to do with the jasper reports version you are using, try downgrading. The issue was reported here

Kris
  • 5,714
  • 2
  • 27
  • 47
  • could you please tell me the the suitable versions of jasper report and dynamic jasper to generate a dynamic jasper report. – Harsha Sep 15 '11 at 08:15
  • Dynamicjasper 3.1.9 was released on 23 of June, 2011, so I guess it should work with Jasprereports 4.0 or if not, then with 3.7 version – Kris Sep 15 '11 at 08:54
  • I can confirm that version 4.0.0 works with DynamicJasper 3.2.1. Thanks! – janhink Jan 12 '12 at 08:25
1

The issue is mainly because of jar file mismatches. It depends on which Jasper version you are using with DynamicJasper. On DynamicJasper's download page you will find information about compatibility versions here is summary:

  • DJ 5.x works with JasperReposrts 4.6.+
  • 5.x and 6.0.x. (JDK 1.6 needed)
  • DJ 4.x workrs with JasperReports 4.1 to 4.5.x
  • DJ 3.0.5 works with JR 3.5 up to 4.0

For future updates refer http://dynamicjasper.com/download/ for version compatibility.

Kmeixner
  • 1,664
  • 4
  • 22
  • 32