根据条件将 RDLC 中的值与两个数据集相加
Sum values in RDLC with two datasets according to condition
我需要对一些值求和并在 RDLC 中显示。 RDLC 包含两个数据集。同一数据集中有两个字段; TipValute 和 Iznos。
如果 TipValute 包含值 0,则对字段 Iznos 中的所有值求和。
我的表情是这样的:
=Sum(IIF(First(Fields!TipValute.Value=0, "DataSet1"),First(Fields!Iznos.Value, "DataSet1"),0))
但我收到类似
的错误
Error 3 The Value expression for the text box ‘Textbox96’ uses an aggregate expression without a scope. A scope is required for all aggregates used outside of a data region unless the report contains exactly one dataset.
和
Error 1 The Value expression for the textrun ‘Textbox96.Paragraphs[0].TextRuns[0]’ uses a First, Last or Previous aggregate in an outer aggregate. These aggregate functions cannot be specified as nested aggregates.
我用这个表达式试过
=Sum(IIf(Fields!TipValute.Value=0, Fields!Iznos.Value, 0), "DataSet1")
但在报告中我得到#Error
我做错了什么?
试试这个...
=总和(IIF(字段!TipValute.Value=0,字段!Iznos.Value,0))
如果应该是:
Sum(IIf(Fields!TipValute.Value=0, cdbl(Fields!Iznos.Value), 0), "DataSet1")
似乎密钥在 cdbl
我需要对一些值求和并在 RDLC 中显示。 RDLC 包含两个数据集。同一数据集中有两个字段; TipValute 和 Iznos。 如果 TipValute 包含值 0,则对字段 Iznos 中的所有值求和。
我的表情是这样的:
=Sum(IIF(First(Fields!TipValute.Value=0, "DataSet1"),First(Fields!Iznos.Value, "DataSet1"),0))
但我收到类似
的错误Error 3 The Value expression for the text box ‘Textbox96’ uses an aggregate expression without a scope. A scope is required for all aggregates used outside of a data region unless the report contains exactly one dataset.
和
Error 1 The Value expression for the textrun ‘Textbox96.Paragraphs[0].TextRuns[0]’ uses a First, Last or Previous aggregate in an outer aggregate. These aggregate functions cannot be specified as nested aggregates.
我用这个表达式试过
=Sum(IIf(Fields!TipValute.Value=0, Fields!Iznos.Value, 0), "DataSet1")
但在报告中我得到#Error
我做错了什么?
试试这个...
=总和(IIF(字段!TipValute.Value=0,字段!Iznos.Value,0))
如果应该是:
Sum(IIf(Fields!TipValute.Value=0, cdbl(Fields!Iznos.Value), 0), "DataSet1")
似乎密钥在 cdbl