Adding code within the Code region
Im trying to add some code to the code region (right click outside of a report > Report Properties > Select Code). When i get to this region i try and add some code so i can go to all textboxes and assign the code to it (in other words when i need
to change the visibility i can change it at one place).
I wrote the code as
Public Shared Function TextboxConfig As Boolean
IIF (Fields!SomeField.Value = "Hello Tom", True, False)
End Function
I then went to my texbox and under visibility i created the expression =Code.TextboxConfig. However i get the error
"There is an error on line 1 of custom code: [BC30469] Reference to a non-shared member requires an object reference."
Could anyone help here and clarify why this is occurring?
Thanks
August 14th, 2012 10:52am
Public Shared Function TextboxConfig(SomeField as String) As Boolean
if SomeField = "Hello Tom" then
TextboxConfig = True
else
TextboxConfig = False
end if
End Function
call with =Code.TextboxConfig
("Hello Tom")
Think out of the box
Free Windows Admin Tool Kit Click here and download it now
August 14th, 2012 11:01am
Public Shared Function TextboxConfig(SomeField as String) As Boolean
if SomeField = "Hello Tom" then
TextboxConfig = True
else
TextboxConfig = False
end if
End Function
call with =Code.TextboxConfig
("Hello Tom")
Think out of the box
I would just change the call for
=Code.TextboxConfig
(Fields!YourField.Value)
Alex
August 14th, 2012 11:16am