Ignore my previous, Cathy. I found it by double-clicking. I've never seen/used this before.
Your method doesn't seem to work for me. I've double-checked everything you've suggested, but it's just not happening.
_VFP.SetVar('rnTotalFreight', rnTotalFreight + frt_chg)
in the OnExit for the Group Footer band. It didn't work there. But when I put it in the OnExit for the Detail band, everything was fine.
Thanks very much!!!
>>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.