You might be able to use a Running Total, if so DBlank is sure to respond. My solution is, usually, and definitely in this case shared variables. Depending on how your report is structured, ie how many groups you have and how often you want the total to display will determine some of these instructions but in general the formulas for shared variables works in groups of 3.
1) in the group header to set the variable = 0
2) in the details section to increment the variable (in your case something like:
shared numbervar totInvoice := totInvoice + TotalCost;
3) in the group footer to display the variable.
shared variables are pretty easy to use and there are lots of posts regarding this procedure.
HTH