I am also having problems with subsummaries in reports, including the same issue where the trailing subsummary displays the same total for all groups.
I have created two leading and two trailing subsummaries for my report: the break field for the first is the foreign key, and the second is another field. The foreign key based subsummary doesn’t display at all in print preview, leading or trailing, and I can’t work out why. The second leading subsummary works fine, but trailing it always displays the same total.
Report layout is:
title header
header
leading subsummary (FK)
leading subsumary (other field)
body
trailing subsummary (other field)
trailing subsummary (FK)
footer
At the moment you can’t have a field both in a trailing and in a leading subsummary. We are investigating if and how soon we can support reusing fields in multiple parts.
Any ideas or possible solutions yet for the original question?
wgknowles:
The aggregate is diplaying the same value on every occurance at the end of each group. I want it to sum up the totals for only the group’s orders.
At the moment you can’t have a field both in a trailing and in a leading subsummary. We are investigating if and how soon we can support reusing fields in multiple parts.
jaleman,
This is worded such that is seems you meant only if a field is reused, eg. the same field in both the leading and trailing subsummary would a problem occur.
I have removed all fields from the leading subsummary, and it is working correctly.
So for now you can only make use of either the leading or the trailing subsummary parts, not both simultaneously.
I hope this will be patched in a 2.0.5 release and not bundled into 2.1?
Thank-you all for your help. I removed the trailing subsummaries and moved the totals fields to the leading subsummaries, which fixed the totals issue. I look forward to being abe to use both leading and trailing subsummaries, but this is quite workable for now!
Regarding the field which was not displaying, you were right, it was related to the sorting. I had sorted it by the fields I was displaying, but this didn’t include the FK itself - I changed the break field to a combination of the fields I was displaying, and then it all works nicely…
eg. break field customer_id, sorting by and displaying surname and firstname doesn’t work, but change the break field to surname and firstname and it does. Seems so logical now!