Jump to content

How can I use JSON subdata source.


bujdei_alexandru

Recommended Posts

Look, I have a jasper report with json ds.

{     "customername":"home",   "workSiteRows":[        {           "invoiceRows":[              {                 "candidateName":"name1",               "units":"13:00"            },            {                 "candidateName":"name2",               "units":"18:30"            }         ],         "workSiteName":"wsname1"      },      {           "invoiceRows":[              {                 "candidateName":"name1",               "units":"13:00"            },            {                 "candidateName":"name2",               "units":"18:30"            }         ],         "workSiteName":"wsname2"      }   ]}[/code]

json has this format:

 
I am adding a subreport like this:
 
<subreport isUsingCache="false"><reportElement x="0" y="10" width="555" height="30" uuid="b2d96c34-ad5d-4eb2-b218-43aad4e09282"/><dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JsonDataSource)$P{REPORT_DATA_SOURCE}).dataSource("workSiteRows")]]></dataSourceExpression><subreportExpression><![CDATA[$P{REPORT_DIR} + "\invoice_ws_row.jasper"]]></subreportExpression></subreport>[/code]
 
I keep getting the following exception:
Error filling print... java.lang.NoClassDefFoundError: org/codehaus/jackson/JsonNode java.lang.ClassNotFoundException: org.codehaus.jackson.JsonNode
 
 
But it does not work.

The problem is that currently jackson core is under the repo "com.fasterxml.jackson.core"

while iReport keeps asking for "org.codehaus.jackson.core".

Tried looking for older versions of jackson core that are under org.codehaus and to add them to the iReport classpath but it still does not work.

I am using iReport 5.6.0 on Windows.

 

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...