View Full Version : Possible Bug on Groups
Anonymous
03-19-2002, 04:26 PM
If the last item of a table is a new group, it does not get picked up by JFreeReport. For example, if I group on letter:
Letter Value
A 100
A 100
B 200
The rpeort will only show A. If I add one more B like in:
Letter Value
A 100
A 100
B 200
B 300
then I'll see all data
Anonymous
03-20-2002, 03:45 AM
Hi Steven,
Sounds like a bug. I'll try out your example and fix the problem. I need to document the state model too (I have a scribbled drawing on my desk), so maybe I'll do that at the same time...
Regards,
DG.
Anonymous
03-22-2002, 01:27 PM
I've fixed the problem when the last row is the only row of a group (I think). In the JFreeReport class in the advanceState method in the area where testing:
else if (state==ReportState.POST_ITEM_GROUP_FOOTER) {
there are two spots where you test to see if the current row is the last row using:
if (rs.getCurrentItem()<(data.getRowCount()-1))
line numbers are:
699 and 723 (I think)
They should be using the test:
if (rs.getCurrentItem()<(data.getRowCount()))
because in the section where you print the item band, you advance the current row to the next row. This is done before coming to the POST_ITEM_GROUP_FOOTER.
Steve
Anonymous
03-27-2002, 10:44 AM
Hi Steven,
I agree that your changes fix the problem, so I've added them to the source tree for inclusion in the next release. Thanks...
DG.