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报告(rdlc)值表达式和空检查_Reporting Services_Null_Ssrs 2008 - Fatal编程技术网

Reporting services SSRS报告(rdlc)值表达式和空检查

Reporting services SSRS报告(rdlc)值表达式和空检查,reporting-services,null,ssrs-2008,Reporting Services,Null,Ssrs 2008,只是想知道以下用于值的表达式是否等效(数据集“MyDataSet”中的列“Contrib”可为空): 备选案文1: =Format(First(Fields!Contrib.Value, "MyDataSet"), "C2") 备选案文2: =IIF(First(Fields!Contrib.Value, "MyDataSet") Is Nothing, "", Format(First(Fields!Contrib.Value, "MyDataSet"), "C2")) i、 e.SSR是

只是想知道以下用于值的表达式是否等效(数据集“MyDataSet”中的列“Contrib”可为空):

备选案文1:

=Format(First(Fields!Contrib.Value, "MyDataSet"), "C2")
备选案文2:

=IIF(First(Fields!Contrib.Value, "MyDataSet") Is Nothing, "", Format(First(Fields!Contrib.Value, "MyDataSet"), "C2"))

i、 e.SSR是否有特殊处理,因此在选项1中,它会在内部检查空值,并有效地执行类似于选项2的操作。通过反复试验,它们似乎给出了相同的结果(当“Contrib”为空/不为空时),但只是想确定一下

在my experence Reporting Services中,如果值为空,则默认情况下将输出一个空值

当您使用IIF修改结果时,我认为您的问题可能类似于我在计算列上防止被零除错误的问题

IIF将计算它的所有操作数,因此即使在“false”部分出现被零除,也会发生错误。我通过在报告中显示“-”来获取一个除以零的结果,并使用嵌套的IIF将除数替换为值1,但此结果从未在报告中显示

=IIf(Fields!LastYearMonthToDateSales.Value = 0, "-", (Fields!ThisYearMonthToDateSales.Value - Fields!LastYearMonthToDateSales.Value) / Abs(IIf(Fields!LastYearMonthToDateSales.Value = 0, 1, Fields!LastYearMonthToDateSales.Value)))
谢谢,我有负数的问题,我用
Math.Abs((Sum(Fields!Amount.Value))