SSRS报告 - 表达式 - 在每个大写字母

时间:2016-05-03 21:48:25

标签: reporting-services ssrs-2012

我的SSRS报告名称为TestReport.rdl。我想使用此报告名称作为报告标题。在文本框中 - >表达式 - >我需要将“TestReport”转换为“Test Report”。

在表达式中,如果我提供 = Globals!ReportName ,则报告的名称(TestReport)将显示在文本框中。但是,我需要在Test和Report之间插入一个空格。是否可以使用SSRS中的表达式来完成它?

当我尝试使用像=System.Text.RegularExpressions.Regex.Replace

这样的正则表达式时,我收到语法错误

1 个答案:

答案 0 :(得分:0)

在这里,试试这个:

=System.Text.RegularExpressions.Regex.Replace(Globals!ReportName, "(?<=[a-z])([A-Z])"," $1")

这是我的报告rdl名称:

enter image description here

现在这是使用上面表达式的输出。

enter image description here

注意:分隔rdl名称的依据是大写字母。因此,如果您的rdl名称都是小写字母,则不会分开。下一个单词应以大写字母开头分隔。

相关问题