SSRS Running totals (ROW COUNT VERSION)

Running totals are one of those things that are used a lot in reporting, and custom running totals end up being used more than not. In this post we will have a quick code to show row numbers by custom increments, so hidden rows and groups etc, will not effect this. I Modified my standard Running Total code to simplify this when rownumber() was failing for me.

Step 1 : report code

public dim RunningTotal as int32 = 1

public function IncreaseRunningTotal(a as boolean) as boolean
if a then
RunningTotal= 1
return true
end if
RunningTotal= RunningTotal+ 1
return false
end function

Step 2 Increment :

=Code.IncreaseRunningTotal( False)

Step 3: reset

=Code.IncreaseRunningTotal(true)

Step 4 Display

=Code.RunningTotal

SIMPLE! 😀