Jump to content
We've recently updated our Privacy Statement, available here ×

JSONQL: How to access JSON data outside the data array


frank.leverenz

Recommended Posts

Hi,

How to access JSON data outside the data array?

I have a simple JSON File and the JSON Data Adapter with jsonql

{    "inventory": {        "inventur": "Test_2_INT_2021-08-02",        "supplier": "114609",        "date": "Aug 19, 2021"    },    "assets": [        {            "asset": "OA_S10005204",            "partnumber": "7341719-2",            "inventnr": "10056137"        },        {            "asset": "OA_S10005208",            "partnumber": "7338320-3",            "inventnr": "10056126"        }    ]}[/code]

The jsonql query is "assets" and in the "Details"-area I can access all assets data: see attached screenshot

In the "Title"-area I need the $.inventory.inventur field but can't get it run

I tried

    <field name="inventory.inventur" class="java.lang.Integer">        <property name="net.sf.jasperreports.jsonql.field.expression" value="inventory.inventur"/>        <fieldDescription><![CDATA[$.inventory.inventur]]></fieldDescription>    </field>[/code]


but the result is "null": see attached Screenshot

I also tried

    <queryString language="jsonql">        <![CDATA[]]>    </queryString>[/code]

but in this case the "assets" data array ist missing

Any idea?

Thanx

Frank

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...