It sounds like you are doing everything right.
I suspect there is a formula that is re-initializing the OrderQty variable between the sub-report and where you write it in the main report.
It's hard to debug without seeing the report. If you could attach a copy I could take a look.
Meanwhile, here's a sample report that works.
. . . download and change the file type extension from .txt to .rpt