Sometimes I receive questions from readers that make it to a new posting.
The other day I received a question about a modification to an earlier post about SSRS and running totals.
This reader wanted a running total in the footer of the page AND a running total in the body of the page, at the start to be exact.
I got this example (the right one was the one requested)
So I start with a basic table with some values and the query used in the dataset.
A simple table and page header / footer.
Preview looks good.
But now for the two running totals.
The first one (at the bottom) is simple.
I just create a new column (that will be hidden in the real report) and add an expression in the rows.
I named the textbox HiddenRunning and referred to it in the footer like so:
=”Footer text with running total : ” + cstr(ReportItems!HiddenRunning.Value)
Now this should give me a footer with some text and the running total.
Next the running total at the start of the body.
Now this seems more difficult, but it is actually simple as well.
I created a second column and added an expression in the row.
=RunningValue(Fields!Value.Value,Sum,”table1″) – Fields!Value.Value
Looks similar right? The only addition is the subtraction of the value from the first item. So this should give me a running total from the previous page(s).
I named the textbox HiddenRunningTotalMinus1Row.
Now you can refer to it somewhere else in the body (just make sure it is above the first row).
And look at the preview:
Looks a lot like the request.