To manage the widow orphan issue, I have put all my summary fields in the body and I hide them based on the record number within its category. Client did not like having the subtotals under the last record because if in one category there was only one item you would end up with an overkill.
The new selected arrangement is to put it near its corresponding group title:Unfortunately, placed besides the leading merge field displaying the group title, you can see that the same field provides different results depending of where it is placed. Remember that this is a body part.
This is because the Merge field that seems heading the group is the first record's value for that field. In order to see the entire group total, I need the last value of the running summary which is displayed only with the last record of the group. I attempted a cheat, by setting a variable in the print setup script. It does work for the first groups but doesn't for the subsequent because I cannot move to the next record from within a calc.
I spent the day trying various strategies and believe I am onto something now but it does not yet yield the result I am expecting.
Here is what I have thought to do:
I have thought that, if I can set a field in each record with the result of a calculation that reflect what this record's group is at the top level and another field with the record's group value for the second level.
Initially I hoped that the relation itself filtering the records
would give the right summary count for the current records entire group. I would either get the sum of all summaries for the category (not running) or the value of the running summary for the first record of each group.
At first I did not have a group match field. It occured to me that it was the way to specify which group to summarize and that passing that value to a field in each record would allow me to put the Name of Category merge field and the CalcCat(the group total summary) merge field side by side at the top. CalcCat would have to have an auto replace that GetAsText the Value passed by the match field so that it does not get recalculated when the report is built.
However, to set the gCat Group Match field to that value, I would need loop to produce the fast summary for the group of the record, set the gCat Group Match field in order to get the value in each record of the group CalcCat field. I have not figured how to reproduce the method within a calculation to auto-set the field. Auto setting the unstored calculated field is what would allow to cycle through the values depending of the current group name in the report.
Am I completely off? is there an easier way to achieve that? Thank you!