如何编写复杂的条件SRSS表达式 [英] How to write a complex conditional SRSS expression

查看:98
本文介绍了如何编写复杂的条件SRSS表达式的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在SRSS中有一个结果集,就像我在下面提到的那样。我需要将不是 - 的元素四舍五入到一位小数。我如何在SRSS 2008报告服务中做到这一点。







名称Sio2



HRSG11 -



HRSG12 -



HRSG13 - < br $>


HRSG14 1.0212



HRSG15 2.233



HRSG21 23.11



我是这样写的



IIf(Fields!SiO2Lab.Value<> - ,格式(Int(Fields!SiO2Lab.Value),N0),true)



但它给我输出像





名称Sio2



HRSG11 #Error



HRSG12 #Error



HRSG13 #Error



HRSG14 1



HRSG15 2



HRSG21 23



底层SiO2的数据类型是NVarchar(最大值)



请帮帮我



问候

-pep

I have a result set in SRSS like I have mentioned below. I need to round the Elements which are not - to one decimal. How I can do this in SRSS 2008 reporting services.



Name Sio2

HRSG11 -

HRSG12 -

HRSG13 -

HRSG14 1.0212

HRSG15 2.233

HRSG21 23.11

I wrote like this

IIf(Fields!SiO2Lab.Value <> "-",Format(Int(Fields!SiO2Lab.Value), "N0"),true)

But it gives me the output like


Name Sio2

HRSG11 #Error

HRSG12 #Error

HRSG13 #Error

HRSG14 1

HRSG15 2

HRSG21 23

The underlying datatype of SiO2 is NVarchar(Max)

Please help me

Regards
-pep

推荐答案

Name	SiO2
HRSG11	        -
HRSG12	        -
HRSG13	        -
HRSG14	       1.232
HRSG31	       2.232
HRSG31	       3.344

After writing the expression : IIf(Fields!SiO2Lab.Value <> "-",Format(Int(Fields!SiO2Lab.Value), "N0"),true)

Name	    SiO2
HRSG11	     #Error
HRSG12	      #Error
HRSG13	      #Error
HRSG14	      1.232
HRSG31        2.232
HRSG31	      3.344


这篇关于如何编写复杂的条件SRSS表达式的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆