Report Builder 3.0 创建具有不同数据类型的表达式

Report Builder 3.0 Creating a expressions with different data types

我在 Report Builder 3.0 中为我的报告 SQL 添加了 4 个字段。前 3 个字段是 Decimal (5),最后一个是 Varchar (81)。报告 运行 很好,但我想在布局的表达式中组合 4 个字段。这是我的:

=Fields!TEAM_ID.Value & '  ' & Fields!GRP_ID.Value & '  ' & Fields!TERR_ID.Value & '  ' & Fields!LNAM.Value

当我尝试 运行 报告时,我收到一条错误消息,内容为“值表达式....包含错误。预期为表达式。

我有两个问题:

(1) 这个表达式有什么问题? (2) 如何用 0(零)支付前 3 个字段。前3个字段的长度应为3个字符,例如76应为076,1应为001等

感谢帮助.......

1) 你应该使用双引号而不是单引号

2) 使用 Format() 函数

=Format(Fields!TEAM_ID.Value,"000") & "  " & Format(Fields!GRP_ID.Value,"000") & "  " & Format(Fields!TERR_ID.Value,"000") & "  " & Fields!LNAM.Value