I’ve spent way too many hours trying to figure this out so hopefully someone can help… I’ve got a json that is a list that contains a list which contains another list (triple nested list) and I have a xlsx template so I should be able to do this. I can print out a list within a list for the report but not the next layer. Please see below for the xml and json. The xml uses jsonpath evaluation to get the data for the template.
JSON:
{
"CarList": [
{
"CarId": 1,
"CarName": "Tatla",
"CarMakeList": [
{
"CarId": 1,
"CarMakeId": 1,
"CarMakeName": "Jeep",
"CarMakeModelList": [
{
"CarMakeId": 1,
"CarMakeModelId": 1,
"CarMakeModelName": "Cherokee"
}
]
},
{
"CarId": 1,
"CarMakeId": 2,
"CarMakeName": "Mercedes",
"CarMakeModelList": [
{
"CarMakeId": 2,
"CarMakeModelId": 2,
"CarMakeModelName": "C63S"
}
]
},
{
"CarId": 1,
"CarMakeId": 3,
"CarMakeName": "Chevy",
"CarMakeModelList": [
{
"CarMakeId": 3,
"CarMakeModelId": 3,
"CarMakeModelName": "Silverado"
}
]
}
]
},
{
"CarId": 2,
"CarName": "Samrai",
"CarMakeList": [
{
"CarId": 2,
"CarMakeId": 4,
"CarMakeName": "Porsche",
"CarMakeModelList": []
},
{
"CarId": 2,
"CarMakeId": 5,
"CarMakeName": "Mercedes",
"CarMakeModelList": []
}
]
},
{
"CarId": 3,
"CarName": "Bhangu",
"CarMakeList": [
{
"CarId": 3,
"CarMakeId": 6,
"CarMakeName": "Porsche",
"CarMakeModelList": []
},
{
"CarId": 3,
"CarMakeId": 7,
"CarMakeName": "Mercedes",
"CarMakeModelList": []
},
{
"CarId": 3,
"CarMakeId": 8,
"CarMakeName": "Toyota",
"CarMakeModelList": []
}
]
}
]
}
XML:
<?xml version="1.0" encoding="UTF-8"?>
<report name="report">
<templates>
<template code="DEFAULT" documentName="NestedBandsTestReportPdf.xlsx" documentPath="NestedBandsTestReportPdfTemplate.xlsx" outputType="pdf" outputNamePattern="NestedBandsTestReportPdf.pdf"/>
</templates>
<rootBand name="Root" orientation="H">
<bands>
<band name="CarListBand" orientation="H">
<bands>
<band name="CarMakeListBand" orientation="H">
<bands>
<band name="CarMakeModelListBand" orientation="H">
<queries>
<query name="CarMakeModelListBandData" type="json">
<script>
parameter=param1 $.CarList[?(@.CarId=='${CarListBand.CarId}')].CarMakeList[?(@.CarId=='${CarListBand.CarId}')].CarMakeModelList[*]
</script>
</query>
</queries>
</band>
</bands>
<queries>
<query name="CarMakeListBandData" type="json">
<script>
parameter=param1 $.CarList[?(@.CarId=='${CarListBand.CarId}')].CarMakeList[*]
</script>
</query>
</queries>
</band>
</bands>
<queries>
<query name="CarListBandData" type="json">
<script>
parameter=param1 $.CarList[*]
</script>
</query>
</queries>
</band>
</bands>
</rootBand>
</report>
RESULTING PDF:
My CarListBand and CarMakeListBand print out as expected but CarMakeModelListBand keeps grabbing cherokee for all the makes. I am expecting:
OWNER: Tatla
MAKE: Jeep
MODEL: Cherokee
MAKE: Mercedes
MODEL: C63S
MAKE: Chevy
MODEL: Silverado
OWNER: Samrai
MAKE: Porsche
MODEL:
MAKE: Mercedes
MODEL:
OWNER: Bhangu
MAKE: Porsche
MODEL:
MAKE: Mercedes
MODEL:
MAKE: Toyota
MODEL: