I use the WebService Query to call an API script as datasource.
The datasource is a JSON.
To be able to filter on TransportProperties: CTRTYPE I use $F{PropertyCode}.equalsIgnoreCase("CTRTYPE") as Filter Expression
I get "20 DV" as result.
{ "Reference": "T03641955", "PublicId": "ZIMU-135721-8", "TransportProperties": [ { "PropertyCode": "CUSTDOC", "PropertyDescription": "Customs Doc", "Value": null, "DisplayValue": null, "Id": 5197 }, { "PropertyCode": "DG", "PropertyDescription": "Dangerous Goods", "Value": null, "DisplayValue": null, "Id": 5198 }, { "PropertyCode": "CTRTYPE", "PropertyDescription": "Container Type", "Value": "20 DV", "DisplayValue": "20 DV", "Id": 5202 } ], "Id": 1065 }
This is working great, but when I want to do something similar for ExtraQuantities, I don't get the desired result
$F{Good.ExtraQuantities.UnitId}.equalsIgnoreCase("2")
[ { "OrderItemId": 275, "Good": { "StockInfoConfig": { "ProductId": 408, "OwnerId": 5, "LocationId": 2875, "ExtraQuantities": [ { "Quantity": 1000.00, "UnitId": 2, "MeasurementUnitId": 1, "Id": 61308 }, { "Quantity": 1092.00, "UnitId": 3, "MeasurementUnitId": 1, "Id": 61309 } ], "Id": 15327 }, "Id": 15327 } ]
1 Answer:
Posted on September 12, 2019 at 2:55pm
Have a look at JSONQL expressions.
http://jasperreports.sourceforge.net/sample.reference/jsonqldatasource/index.html#jsonqldatasource
The order of items in the result of the filter expression is the same as the order in which those items appeared in the primary expression.