【发布时间】:2016-01-10 19:14:59
【问题描述】:
我对 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}) 时,我仍然将 List 作为字符串,它只是显示为
[[line number : line1, product: ProdA],[line number : line2, product: ProdB]]
不应该使用这个 JRMapCollectionDataSource 已经为我解析出来了吗?如果没有,我该如何处理?
【问题讨论】:
标签: list mongodb jasper-reports