I need to create a report which datasource is a JSON that basically is an array of objects (masterElement), and this objects have another nested array of objects (childElement).
Here´s a simplified example of it:
Code: Select all
{
"masterElement": [
{
"type": "Type 001",
"position": 1,
"configurable": "EDITABLE",
"childElement": [
{
"position": 1,
"indicator": "Indicator 001",
"contentType": "Liquid",
"containerType": "50ML",
"status": "FILLED"
},
{
"position": 2,
"indicator": "Indicator 002",
"contentType": "Liquid",
"containerType": "20ML",
"status": "FILLED"
},
{
"position": 3,
"indicator": "Indicator 003",
"contentType": "Liquid",
"containerType": "20ML",
"status": "FILLED"
},
{
"position": 4,
"indicator": "Indicator 004",
"contentType": "Liquid",
"containerType": "50ML",
"status": "FILLED"
},
{
"position": 5,
"indicator": "Indicator 005",
"contentType": "Liquid",
"containerType": "50ML",
"status": "FILLED"
},
{
"position": 6,
"indicator": "Indicator 006",
"contentType": "Liquid",
"containerType": "50ML",
"status": "FILLED"
},
{
"position": 7,
"indicator": "Indicator 007",
"contentType": "Liquid",
"containerType": "50ML",
"status": "FILLED"
},
{
"position": 8,
"indicator": "Indicator 008",
"contentType": "Liquid",
"containerType": "50ML",
"status": "FILLED"
},
{
"position": 9,
"indicator": "Indicator 009",
"contentType": "Liquid",
"containerType": "50ML",
"status": "FILLED"
},
{
"position": 10,
"indicator": "Indicator 010",
"contentType": "Liquid",
"containerType": "50ML",
"status": "FILLED"
},
{
"position": 11,
"indicator": "Indicator 011",
"contentType": "Liquid",
"containerType": "50ML",
"status": "FILLED"
},
{
"position": 12,
"indicator": "Indicator 012",
"contentType": "Liquid",
"containerType": "50ML",
"status": "FILLED"
},
{
"position": 13,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
},
{
"position": 14,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
},
{
"position": 15,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
},
{
"position": 16,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
},
{
"position": 17,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
},
{
"position": 18,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
},
{
"position": 19,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
},
{
"position": 20,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
},
{
"position": 21,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
},
{
"position": 22,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
},
{
"position": 23,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
},
{
"position": 24,
"indicator": "",
"contentType": "",
"containerType": "",
"status": "EMPTY"
}
]
},
{
"type": "Type 002",
"position": 2,
"configurable": "EDITABLE",
"childElement": [
{
"position": 1,
"indicator": "Value 01",
"contentType": "Liquid",
"containerType": "20ML",
"status": "FILLED"
},
{
"position": 2,
"indicator": "Value 02",
"contentType": "Liquid",
"containerType": "20ML",
"status": "FILLED"
},
{
"position": 3,
"indicator": "Value 03",
"contentType": "Liquid",
"containerType": "20ML",
"status": "FILLED"
},
{
"position": 4,
"indicator": "",
"contentType": "",
"containerType": "",
"sampleType": "",
"status": "EMPTY"
},
{
"position": 5,
"indicator": "",
"contentType": "",
"containerType": "",
"sampleType": "",
"status": "EMPTY"
},
{
"position": 6,
"indicator": "",
"contentType": "",
"containerType": "",
"sampleType": "",
"status": "EMPTY"
},
{
"position": 7,
"indicator": "",
"contentType": "",
"containerType": "",
"sampleType": "",
"status": "EMPTY"
},
{
"position": 8,
"indicator": "",
"contentType": "",
"containerType": "",
"sampleType": "",
"status": "EMPTY"
},
{
"position": 9,
"indicator": "",
"contentType": "",
"containerType": "",
"sampleType": "",
"status": "EMPTY"
},
{
"position": 10,
"indicator": "",
"contentType": "",
"containerType": "",
"sampleType": "",
"status": "EMPTY"
}
]
}
]
}
Representing it as Master-Detail structure do the job, but here that we need to do it in a more graphical way (using shapes, specific position for the elements, etc) I don´t know how to do it.
Here´s the structure that I need to represent:
As you can see, the childElements have a item indicating a position, the text to show and shape/image that can change base on one of its attributes.
Is there any way to access to the childElement attribute of a masterElement when you´re looping it to access its properties using an expression?
Or should I adapt the JSON structure removing this nested structure to represent it in a report?
Any help would be appreciated.
Thanks in advance.