Insert code in report
Fo example, I want to use a method for to round a number.
Thx!!
VB function can be referenced from the report's code object. Here is an example:
If you want to use the Math.Round function, place code similar to this in report's code block :
shared function RoundNum( byVal Number as Decimal ) as Decimal =Math.Round( Fields!Current_Balance.Value, 5 ) Hope this helps.
'round to one decimal place
return Math.Round( Number, 1 )
end function
Then, to reference it in the report, simply use an expression like this :
=Code.RoundNum(Fields!Current_Balance.Value)
Or, you could simply refer to Math.Round from within the report item's expression, thuswise: