Friday, 30 January 2015

How to produce a jasper report from xml with grouping by date



I'm having difficulty using iReport to work with Jasper in order to report on the following xml.


My difficulty lies in understanding the grouping mechanism.


I am trying to group the entries by month, so I can show totals by month under each set.


And finally ending the report with grand totals.


A sample xml is as such:



<root>
<color>red</color
<reportDate>Fri Jan 30 21:50:50 CET 2015</reportDate>
<drinks>
<entry>
<date>2014-11-26 09:30:18.689</date>
<name>cola</amountBilled>
<measure>100</measure>
</entry>
<entry>
<date>2014-11-26 10:30:00.000</date>
<name>milk</amountBilled>
<measure>10</measure>
</entry>
<entry>
<date>2014-11-26 13:01:18.112</date>
<name>cola</amountBilled>
<measure>100</measure>
</entry>
<entry>
<date>2014-11-27 09:30:18.689</date>
<name>cola</amountBilled>
<measure>100</measure>
</entry>
</drinks>
</root>


My approach to date is to use a table with a subdataset that i've put in the detail section. As for grouping and especially by month, I'm stuck.


Thanks.


No comments:

Post a Comment