The issue with a running sum is that it depends on the sort order of the records. If that changes the running sum needs to be re-evaluated/re-calculated. A report has a fixed order, so it can be calculated as each row is printed, and will not then change.
The underlying reason it's hard is that a set of records (a recordset) is a collection of individual records. Therefore for each record the next and previous records are not defined. Because there is no concept of a "next" record for a data set, there is just no such thing as a simple running sum of which you can keep track. So there is no formula for a running sum.
So although you could find an inefficient way to do it, it's best not to bother, and just consider, for example, the total of the set of records, rather than the partial total evaluated as you navigate through the records. That way, you work with what you have.
In the case of a collection of stock records, it ought to be enough that the entire collections sums to 12,500 widgets, and not bother about what the partial total was after each individual transaction that comprised the total of 12,500. What does it matter that the total WAS 12,520, and you just reduced that total by 20 with the last sale record. If you sorted it by transaction amount, rather than date, the running total declares differently, but the final total is still the same. Hence concentrate on the final total.
With a trial balance in a ledger, for instance, you just need to know the total for each account, and that the overall total of all the transactions is zero. When the ledger was maintained manually, you would have to sum the figures as you went, but we handle the records differently and more flexibly now, and we don't need the running balance. The manual entries resembled a report, so you naturally obtained a running balance. If you made an addition error, your books of account would not balance.
In contrast the "trial balance" process with computer data merely verifies that the grand total is zero, and therefore the subtotals can be relied upon. if it doesn't balance then one of the individual "double entry" transaction sets must have failed (been out of balance), and you then need a way of summing each "double entry" subset to find and review the one(s) that didn't add to zero. There may be 100,000 records all summing to zero. The running totals are of no importance at all, just the overall total.