正如评论中提到的,SSRS 不会将“$1”标识符大写,因为它将把它当作文字字符串。
作为解决方法,我建议您使用此自定义代码:
转到报告属性/代码并输入以下代码:
Function ProperCase(InputString as String) As String
Dim i as Integer
If InputString <> "" Then
Mid(InputString , 1, 1) = UCase(Mid(InputString , 1, 1))
For i = 1 To Len(InputString) - 1
If Mid(InputString, i, 2) = "." + " " Then
Mid(InputString, i + 2, 1) = UCase(Mid(InputString, i + 2, 1))
End If
Next
Return InputString
End If
End Function
要使用它,请在您的文本框中调用它,如下所示:
=Code.ProperCase(LCase(Fields!Title.Value))
我已经测试了这个字符串:
some test sentence. second Sentence. SHOULD THIS BE CAPITALIZED?
它返回:
Some test sentence. Second Sentence. Should this be capitalized?
让我知道这可以帮助你。