I need to make report like this:
Product Name : Product XYZ
---------------------------------
| Item Name | Quantity | Price |
---------------------------------
| Item ABC | 10 | 10 $ |
| Item BCD | 10 | 1 $ |
Product Name : Product XYZ2
---------------------------------
| Item Name | Quantity | Price |
---------------------------------
| Item DEF | 15 | 10 $ |
| Item HIJ | 11 | 1 $ |
Summary Report
---------------------------------
| Product Name | Total Quantity |
---------------------------------
| Product XYZ | 20 |
| Product XYZ2 | 26 |
The first problem is "product" can 1 to many.
The second problem is i need "Summary Report" in the bottom
The third problem is ,this raw data report come from json
, not from query to database.
What that i already try :
Create many table for product. But this failed because jasper create empty space for unused table. And the summary table in other page with many empty space.
Subreports , same like above.
Can you tell me please, how to make dynamically multiple table's?
EDIT : sample JSON
{"produkList": {
"items":[
{
"nameProduct": "Product XYZ",
"itemList": [{
"itemName": "XXXXXXX",
"quantity": 50,
"price": 50
},
{
"itemName": "YYYYYYY",
"quantity": 50,
"price": 50
},
{
"itemName": "ZZZZZZZZ",
"quantity": 50,
"price": 50
}]
},
{
"nameProduct": "Product XYZ2",
"itemList": [{
"itemName": "AAAAAAAA",
"quantity": 50,
"price": 50
},
{
"itemName": "BBBBBBB",
"quantity": 50,
"price": 50
},
{
"itemName": "CCCCCCC",
"quantity": 50,
"price": 50
}]
}
],
"summary":[
{
"title": "Summary Report",
"summaryReportDetailList": [{
"nameProduct": "Product XYZ",
"quantity": 150
},
{
"nameProduct": "Product XYZ2",
"quantity": 150
}]
}
]
}
}