>Greetings one and all
>I am attempting to print a group total to the right of the last object on the last detail line of a detail band in "classic accounting journal style". I tried moving the total object to the detail line and printing only on group change. That didn't work. Any ideas??
>
>Thanks, Vince
You can create a report variable that SUMS the total and resets at each data group. The trick is how the detail band is going to figure out whether it is the last record in the data group.
One idea you can do is this:
- Create a report variable called rnLast. Set the initial value to .f. and set the expression to rnLast so that it just sets itself to itself for each detail band.
- Create a data group with an expression of RECNO()
- In the OnEntry expression of the data group, put an expression that calls a UDF or method, such as TestForLast().
- Create the UDF or method with code that remembers the record pointer, moves it ahead one, checks to see if the "next" record is still in the same group, then sets rlLast to true or false depending on what it found. Then make sure to move the record pointer back to the record it was on.
- In the detail band, use rlLast in the Print When expression for that field.
The concept sounds a little weird, but it does work.