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

Warning: file_get_contents(/data/phpspider/zhask/data//catemap/3/go/7.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 来自crystal的SSRS中的自定义If语句_Reporting Services_Crystal Reports - Fatal编程技术网

Reporting services 来自crystal的SSRS中的自定义If语句

Reporting services 来自crystal的SSRS中的自定义If语句,reporting-services,crystal-reports,Reporting Services,Crystal Reports,我正在尝试将以下代码从crystal reports自定义代码转换为在SSRS中工作的代码。 如何在自定义代码/IIF表达式中实现这一点以在SSRS中工作 if {rptSurveyDetail;1.QT1} = 0 then if {rptSurveyDetail;1.Question1} = 0 then "No" else if {rptSurveyDetail;1.Question1} = 1 then "Yes" else "" else if {rptSur

我正在尝试将以下代码从crystal reports自定义代码转换为在SSRS中工作的代码。 如何在自定义代码/IIF表达式中实现这一点以在SSRS中工作

if {rptSurveyDetail;1.QT1} = 0 then
    if {rptSurveyDetail;1.Question1} = 0 then "No" 
        else if {rptSurveyDetail;1.Question1} = 1 then "Yes" else ""
else if {rptSurveyDetail;1.QT1} = 1 or {rptSurveyDetail;1.QT1} = 7 then
    ToText({rptSurveyDetail;1.Question1},0,"") 
else if {rptSurveyDetail;1.QT1} = 2 then
    ToText({rptSurveyDetail;1.Question1},{rptSurveyDetail;1.QP1},"")
else ""
这是目前正在失败的IIF声明。。。它仅显示QT1值1、2和3

=IIF(Fields!QT1.Value = 0, IIF(Fields!Question1.Value = 0, "No", IIF(Fields!Question1.Value = 1, "Yes", "")), IIF(Fields!QT1.Value = 1 or Fields!QT1.Value = 7, Fields!Question1.Value, IIF(Fields!QT1.Value = 2, Fields!Question1.Value & "," & Fields!QP1.Value, "")))

我使用的自定义代码出现语法错误,所以IIF自定义代码的解决方案就可以了

我使用参数进行测试,您需要更改数据集中的字段

=IIf(Parameters!QT1.Value=0 And Parameters!Question1.Value=0, "No", IIf(Parameters!QT1.Value=0 And Parameters!Question1.Value=1, "Yes", IIf(Parameters!QT1.Value=1 Or Parameters!QT1.Value=7, CStr(Parameters!Question1.Value), IIf(Parameters!QT1.Value=2,CStr(Parameters!Question1.Value) & "," & CStr(Parameters!QP1.Value),"")))  )

上面的公式中没有参数。所有字段都来自存储过程

您可以在转换中检查错误部分。在晶体中,假部分可以省略,但在SSRS中,任何条件都必须同时具有真部分和假部分

大多数Crystal报表都可以通过自动转换进行完美转换。您可以查看Crystal迁移服务