Friday, April 22, 2016

SSRS aggregating a text box

Since you're not able to use aggregate functions on text box values. You'll need to do something like this. You'll get an error similar to this "The Value expression for the text box '***' uses an aggregate function on a report item. Aggregate functions can be used only on report items contained in page headers and footers."

Code (Within report properties):
Dim public total as Integer

Public Function AddToTotal(ByVal balance AS Integer ) AS Integer
                total = total + balance
                return balance
End Function

Public Function GetTotal()
                return total
End Function

Expression on the text box that is repeating:
=Code.AddToTotal(your value)

Expression on your total text box:
=Code.GetTotalImpliedMonth()