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

JSONQL: Retrieve values from array wthout key/index


shavaughn70

Recommended Posts

Hi everyone,

I need to retrieve values from JSON datasource without an index/key.

Examples:

"items": [    "items 1",     "items 2",     "items 3",     "items 4",     "items 5"][/code]

How can I retrieve all values from items?

I have tried:

  • items.* (only return first element)
  • items.[n] (only return [n] index element)
  • items.[x:y] (only return [x] index element)

And yes, I have read JSONQL docs http://jasperreports.sourceforge.net/sample.reference/jsonqldatasource/index.html

Thanks!

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

  • 1 year later...

You can pass array as DataSource to a table (for example) like

((net.sf.jasperreports.engine.data.JsonQLDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("items")

And then use array element for Text Field like $F{node}

Link to comment
Share on other sites

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