在脚本中定义两个自定义函数:
Function SplitMm(mmcm As String) As String
Dim i = mmcm.IndexOf("/")
If i >= 0 Then
Return mmcm.Substring(0, i)
Else
Return mmcm
End If
End Function
Function SplitCm(mmcm As String) As String
Dim i = mmcm.IndexOf("/")
If i >= 0 Then
Return mmcm.Substring(i + 1)
Else
Return ""
End If
End Function
然后在调用字段值的地方,使用表达式,调用上述函数:
=Code.SplitMm(Fields!字段名.Value.Tostring())
=Code.SplitCm(Fields!字段名.Value.Tostring())
|