Thanks, Cathy, but I'm not finding an OnExit expression anywhere. Are you sure what you're talking about works in 6.0?
>>Rather than trying to fix what I've apparently done wrong, can someone just tell me how to do it correctly from the start?
>>
>>Here are some of the fields in my cursor:
>>
>>order_no, qty, price, frt
>>
>>Here are a few sample records for order #100:
>>
>>100, 10, 1.23, 50
>>100, 20, 2.00, 50
>>100, 10, 1.50, 50
>>
>>As you can see, "frt" is in each record, but is the total freight for the order.
>
>Any time you use the "calculate" option in the report writer, it is going to process the calculation once for each detail record. Obviously, this isn't what you want for freight because you only want to process it once per order.
>
>If you have a data group on the Order Number, which I suspect you do, give this a try. Add a report variable called rnTotalFreight. Set the value to zero, the calculate option to SUM, and the reset value to End of Report.
>
>Now in the OnExit expression of the data group footer band, enter the following:
>
>_VFP.SetVar('rnTotalFreight', rnTotalFreight + frt)
>
>
>What this concept does is create a report variable that does nothing more than add zero to itself each time it processes a detail band. However, you manually manipulate the variable at the end of each "group" and increase it by the amount of the freight. Now you are only adding the freight once for each order.