JSON Datasource: Reading Sub-Arrays / -Lists

0

Hello,

I am using Jasper Studio 5.5 and try to create a report using a JSON-Datasource. My example json-file looks as followed:

 
{
"dto": [
{
"item": {
"active": 1
},
"itemProjects": [
{"id": 1},
{"id": 2}
]
},
{
"item": {
"active": 1
},
"itemProjects": [
{"id": 3},
{"id": 4}
]
}
]
}

To summarize it: I have an array of "dto"-objects. Each dto contains an object "item" and an array of "itemProjects". Using the Select-Query "dto" and the Fields "item.active" allows me to read the property "acttive". However I have yet to find a way to read the properties from the sub-arrays. I tried it with different Select-Strings and Fieldnames, but had no success. I also tried passing the array as parameter to a subreport, but this also didnt worked (the generated report showed empty fields).

Does anyone know, how to correctly read data from an array inside an array in JSON ?

best regards.

Xecu's picture
70
Joined: Dec 16 2013 - 5:49am
Last seen: 4 years 6 months ago

1 Answer:

0

Both of these threads deal with arrays in JSON:

in same report:     JasperReports Library Issue #2500

using subreport:   How to deal with JSON-List as JsonDataSource.

 

narcism's picture
1096
Joined: Nov 22 2010 - 12:39am
Last seen: 42 min 13 sec ago
Feedback
randomness