我相當新的JasperReports和我有一個挑戰,獲取列表數據從MongoDB正確顯示。JasperReports MongoDB列表數據
我當時正在關閉article,但似乎無法使其工作。
我在的MongoDB以下集合:
{ "_id" : ObjectId("51e24462945f8796ea8e731d"), "id" : "1001", "cust" : "abc", "
lines" : [ { "line number" : "line1", "product" : "ProdA" },
{ "line number" : "line2", "product" : "ProdB" } ] }
{ "_id" : ObjectId("51e246fb945f8796ea8e731e"), "id" : "1002", "cust" : "abc", "
lines" : [ { "line number" : "line1", "product" : "ProdA" },
{ "line number" : "line2", "product" : "ProdB" } ] }
「線」 是一個集合。
在iReport,它顯示爲一個列表,這是很好的。然而,當我這樣做的文章建議,並更改子數據源到new net.sf.jasperreports.engine.data.JRMapCollectionDataSource($F{lines})
,我仍然得到列表作爲一個字符串,它只是顯示爲
[[line number : line1, product: ProdA],[line number : line2, product: ProdB]]
不應該使用這個JRMapCollectionDataSource已經爲我解析這個了嗎?如果不是,我該如何處理?
這是行不通的。 –