我是Jasper Report的新手,我使用JSON作爲數據源。我有以下數據集作爲示例。如何使用JSON與Jasper Report分組數據集?
{"Northwind": {
"Customers": [
...
],
"Orders": [
{
"ShipPostalCode": 51100,
"ShippedDate": "1996-07-16",
"OrderDate": "1996-07-04",
"OrderID": 10248,
"Freight": 32.38,
"RequiredDate": "1996-08-01",
"ShipCity": "Berlin",
"ShipCountry": "Germany",
"EmployeeID": 5,
"ShipVia": 3,
"CustomerID": "ALFKI",
"ShipAddress": "59 rue de l'Abbaye",
"ShipName": "Vins et alcools Chevalier"
},
...
{
"ShipPostalCode": 44087,
"ShippedDate": "1996-07-10",
"OrderDate": "1996-07-05",
"OrderID": 10249,
"Freight": 11.61,
"RequiredDate": "1996-08-16",
"ShipCity": "Munich",
"ShipCountry": "Germany",
"EmployeeID": 6,
"ShipVia": 1,
"CustomerID": "RATTC",
"ShipAddress": "Luisenstr. 48",
"ShipName": "Martinez Gonzalez"
}
我傳遞ShipCountry
作爲參數傳遞給我的報表,這是工作,因爲它應該。
然而,我的模板顯示相同的數據,兩次,因爲它循環我的數據集,每次對我的子集的每一個對象。 如何按國家分組我的訂單?我怎樣才能使它不顯示重複?就像這樣:
我country_orders_report.jrxml並在GitHub上country_order_list.jrxml代碼。和my whole data,是非常小的:)
希望幫助!
你應該看看:[JasperReports的 - 如何讓JSON來填充報表(http://stackoverflow.com/q/14941002/876298) –
另一個相似的post:[如何在jasper報告中使用json作爲數據源創建多個表?](http://stackoverflow.com/q/34603844/876298) –
@AlexK感謝您的鏈接,但我還不明白:( 我很抱歉,我是Jasper Reports的新手。 –