>>>How to produce the line "Total 9" in report?
>>
>>You'll need several report variables. One would have to keep the group expression, and be initialized to some impossible value.
>
>What is the value to store of this variable? Must it be
>last (third) in the order in the report variable list?
Order of variables:
1. one to keep the group expression, initialize to non-existing value (so it is different from the first group), assign group expression
2. rvGroupHasChanged, initialize to .f., assign FirstVariable=GroupExpression
3. third one goes to keep the totals of the rounded values per person (or just for grand total)
>Maybe to add simply a field
>
>iif(rvGroupHasChanged, RoundedPersonsSalary, 0)
>
>to the summary band? This eliminates the need for a third variable.
I thought we may get a different total if we did the rounding at wrong time. In your example, three people get 3*1.4 rounding up to 3, but 9*1.4 may give 9 or 12, depending on when we do the rounding. When I do this, I'm not quite sure of what goes on behind the scenes, so each time I have to do some experimenting to see what gives. Just like someone said these days, "I didn't understand it until I saw it work, and then it just seemed natural".
I think the credit for this trick goes to Paul Vlad or Fast Eddie - can't remember too well, it was at least half a year ago.