ssrs的动态格式

时间:2013-02-27 22:48:31

标签: reporting-services ssrs-2008 ssrs-tablix csrss

这是我的报告

enter image description here 这是我的结果(但是iddescripcion不可见)

enter image description here

我的问题是。

当iddescripcion = 1,3,5,8或10时,我怎么得到valor将具有10,000(不是小数)的格式 当iddescripcion = 2,4,6或9时,valor将具有1,000.0或3,000.1(小数点后一位)的格式 当iddescripcion = 7,11时,valor的格式为$ 2,389,012(不是decimalsa和$ before) 我相信我需要的格式在这里添加它但我不知道该怎么做.. enter image description here

1 个答案:

答案 0 :(得分:1)

您可以使用文本框表达式值中的SwitchIIf语句应用条件格式。

enter image description here

我使用以下表达式将一个简单示例放在一起:

=Switch(Fields!iddescripcion.Value = 1 or Fields!iddescripcion.Value = 2, Format(Fields!valor.Value, "N0")
    , Fields!iddescripcion.Value = 3 or Fields!iddescripcion.Value = 4, Format(Fields!valor.Value, "N1")
    , Fields!iddescripcion.Value = 5 or Fields!iddescripcion.Value = 6, Format(Fields!valor.Value, "$#,#"))

基本上只需基于 iddescripcion 为每一行应用Format valor 。这适用于一些简单的数据:

enter image description here

希望你可以根据你的例子进行调整。