>Thanks for the clarification. That is quite interesting; if I print an incrementing report variable in the detail band, it will have the new value; if I use it to establish groups, it will have the old value! I didn't know that.
It's all a matter of understanding exactly when report variables are processed!! They are processed when the detail band starts ... not in the page header and not in the data group header.
Another point to understand is when a report variable resets. If you mark it to reset at a Data Group, it doesn't reset itself until it STARTS the next data group. This can bite you if a data group finishes on a page, you assume it clears after the data group footer, and then you try to do something with the variable in the page footer assuming it would be zero if the data group just finished. What happens is the variable still holds the value because it doesn't clear itself until it starts the next data group. So the page footer of this page, or the Page header of the next page, still has a value set, even though the data group is done.