主報告使用包含列表(父列表)的數據源。 此列表(parentList)又包含其他列表(childList)。 This childList作爲DataSource(JRBeanCollectionDataSource)傳遞給SubReport。比較數據源中的行以打印特定記錄
This childList包含兩列,下面是列表的表格格式。
<pre>TestString | Date</pre>
<pre> abc | 01JAN12 </pre>
<pre> cdf | 31DEC12 </pre>
<pre> fgh | 08JUN12 </pre>
從上面的表格,日期應該是比較得到的紀錄在這種情況下,最新的日期(即)CDF了「的TestString」值。
比較行或記錄應該在Jasper報告中完成,而不是在java類中。
我該怎麼做?
DataSource是一個SQL表嗎? –
它的JRBeanCollectionDataSource對象 –
JRBeanCollectionDS集合中的對象是什麼?實現一個'比較器'來根據此集合中的日期對對象進行排序。您可以使用'SimpleDateFormat'來分析日期字符串。 –