我需要检查 rdl <code>
文件中两个字符串的相等性。
以下条件仅检查两者或Null值。但我需要检查参数值是否相等。
以下函数是<code></code>
块中编写的自定义函数。
请帮忙。
NPServedasperPolicy
和NPServed
参数值来自报告值。
public function getNoticePeriodStatus
(byval NPServed as String,byval NPServedasperPolicy as String)
if(NPServedasperPolicy = NPServed)
getNoticePeriodStatus = "Notice period Fully Served"
end if
答案 0 :(得分:0)
假设您要显示:
NPServedasperPolicy
和NPServed
不同或两者都为空,则“通知期未提供”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)
为了完整性,这里是普通的表达式等价物:
=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")