Warning: file_get_contents(/data/phpspider/zhask/data//catemap/5/reporting-services/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Reporting services SSRS将整型转换为字符串_Reporting Services_Ssrs 2008 - Fatal编程技术网

Reporting services SSRS将整型转换为字符串

Reporting services SSRS将整型转换为字符串,reporting-services,ssrs-2008,Reporting Services,Ssrs 2008,我的SSRS报告中有一个字段,根据状态显示为1.2.3.4 我现在想把它转换成一个字符串,使它更易于阅读 所以 1:已完成 2:正在进行中 3:取消 4:暂挂最简单的方法是在表达式中使用SWITCH()函数 像这样: =SWITCH(Fields!yourColumn.Value=1, "Completed", Fields!yourColumn.Value=2, "In Progress", Fields!yourColumn.Value=3, "Cancelled",

我的SSRS报告中有一个字段,根据状态显示为1.2.3.4

我现在想把它转换成一个字符串,使它更易于阅读

所以
1:已完成
2:正在进行中
3:取消

4:暂挂

最简单的方法是在表达式中使用SWITCH()函数

像这样:

=SWITCH(Fields!yourColumn.Value=1, "Completed",
    Fields!yourColumn.Value=2, "In Progress",
    Fields!yourColumn.Value=3, "Cancelled",
    Fields!yourColumn.Value=4, "On Hold"
)

这是一篇关于IIF()和SWITCH()的好文章:

非常有效,谢谢@Mike D。