Posted 21 September 2021, 7:12 pm EST
I am a starting user of ActiveReports and I am struggling with the way to access data. Can anyone help me with this?
I am using a JSON file as datasource (example data below).
Based on the datasource I defined a number of datasets:
- orderLine (id, lineReference, orderedQuantity, itemId, itemName)
- deliveredGoods (orderLineId, itemId, itemName, lot, quantity)
- itemAttributes (attributeTypeName, value)
I have a table control with delivered goods. In the table the goods are grouped by itemId. In the group header I am showing the ordered quantity for which I use a lookup function.
I also want to show whether this item has an item attribute of type “Fragile”. Therefore I want to access the item attributes with itemId and attributeTypeName but I don’t know how to do this. The dataset itemAttributes
has no itemId to match on and moreover the lookup function matches only on 1 property.
Example JSON:
“orderLine”: [
{
“id”: 1234,
“lineReference”: “Line20210901-001-1”,
“orderedQuantity”: 200,
“orderedItem”: {
“id”: 123456,
“name”: “Example item”,
“externalProperties”: {
“attributes”: [
{
“attributeTypeName”: “Temperature Classification”,
“value”: “Chilled”
}, {
“attributeTypeName”: “Fragile”,
“value”: “Yes”
}],
},
},
“deliveredGoods”: [
{
“id”: 5678,
“orderLineId”: 1234,
“externalGoodsProperties”: {
“id”: 5678,
“externalProperties”: {
“itemId”: 123456,
“itemName”: “Example item”,
“lot”: “Lot 123”,
“quantity”: 120
}
}
}, {
“id”: 5679,
“orderLineId”: 1234,
“externalGoodsProperties”: {
“id”: 5678,
“externalProperties”: {
“itemId”: 123456,
“itemName”: “Example item”,
“lot”: “Lot 456”,
“quantity”: 80
}
}
}]
}]
Desired result:
ItemId Item name Fragile Lot Quantity
123456 Example item Yes Lot 123 120
123456 Example item Yes Lot 456 80