我是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的新手。 –