Friday, February 24, 2012

Custom Code problem

I have this very basic custom code in my report:
Public Shared Function Basis(byVal Value as Integer) As Double
Basis = Basis + value
End Function
When I call this code, using =Code.Basis(Fields!BWT.Value), I expect it to
be like a running total. But all I get back is whatever the value of
Fields!BWT.Value is, without it adding up. I know that I could use the
runningvalue function, but I am wondering why this code doesn't work?quite possible the value of the function is not static. So everytime you come
into the function the value is reset. Try setting a temp invisible textbox to
basis' value evertime it updates.
"dachrist" wrote:
> I have this very basic custom code in my report:
> Public Shared Function Basis(byVal Value as Integer) As Double
> Basis = Basis + value
> End Function
> When I call this code, using =Code.Basis(Fields!BWT.Value), I expect it to
> be like a running total. But all I get back is whatever the value of
> Fields!BWT.Value is, without it adding up. I know that I could use the
> runningvalue function, but I am wondering why this code doesn't work?

No comments:

Post a Comment