QuickDunk
QuickDunk

Reputation: 73

Subreport with JsonDatasource

I have this error when I try to use subreport with a JsonDatasource in my iReport 4.5.1 Window:

java.lang.ClassNotFoundException: net.sf.jasperreports.engine.data.JsonDataSource

I don't understand why... The subreport expresion is

new net.sf.jasperreports.engine.data.JsonDataSource(new java.net.URL($P{net.sf.jasperreports.json.source}).openStream(),"response.tickets")

This is the full text Exception click_here

How I can to resolve this Exception?

Upvotes: 2

Views: 2282

Answers (1)

Alessandro Alessandra
Alessandro Alessandra

Reputation: 1065

I don't use iReport 4.5.1 but I managed to solve the same problem on 4.6.0 platform.

iReport do not include all jasperreports libraries by default, I found that it includes only:

  • hsqldb-1.8.0-10.jar
  • jasperreports-extensions-3.5.3.jar
  • jasperreports-core-renderer.jar

All you have to do is adding the jasperreports json library into the classpath by clicking the menu tools/options, then in the ireport section clicking on the classpath tabber.

Then click "Add Jar" button and browse to add the missing jar from \iReport-4.6.0\ireport\modules\ext\jasperreports-json.jar

I hope it's not too late...

Upvotes: 1

Related Questions