假设您要显示:
- “Not Served Not Served”如果
NPServedasperPolicy
和NPServed
不同或两者都为空
- “Notice periodfully Served”如果
NPServedasperPolicy
且NPServed
相等
您可以使用以下自定义代码:
Public Function GetNoticePeriodStatus (ByVal NPServed as String,ByVal NPServedasperPolicy as String)
If((Not(NPServedasperPolicy Is Nothing) And Not(NPServed Is Nothing)) and NPServedasperPolicy = NPServed) Then
GetNoticePeriodStatus = "Notice period Fully Served"
Else
GetNoticePeriodStatus = "Notice period Not Served"
End If
End Function
可以这样调用:
=Code.GetNoticePeriodStatus(Parameters!NPServed.Value, Parameters!NPServedasperPolicy.Value)
为了完整起见,这里是普通的 Expression 等价物:
=Iif((Not(Parameters!NPServedasperPolicy.Value Is Nothing) And (Not(Parameters!NPServed.Value Is Nothing))) And Parameters!NPServedasperPolicy.Value = Parameters!NPServed.Value, "Notice period Fully Served", "Notice period Not Served")