SQL Server Report Builder 2012 3.0 中的 Iif 函数
Iif function in SQL Server Report Builder 2012 3.0
我正在尝试制作自动发票,但最后一部分让我卡住了。如果客户与供应商不是来自同一个国家,那么他不应该支付增值税。为了在我的发票中得到这个,我试图插入一个表达式,但它给出了以下错误:
'The Value expression for the textrun ‘Textbox16.Paragraphs[0].TextRuns[1]’ contains an error: [BC30455] Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.'
这是我使用的表达式:
=IIf(First(Fields!CustomerCountry.Value, "Invoice"))<>(First(Fields!SupplierCountry.Value, "Invoice")),0,((SUM(Fields!DurationHours.Value * Fields!HourlyRate.Value))*0.21)
有人可以帮忙吗?
提前致谢
您的 iif 语句中第一个 First
函数处有一个额外的括号。试试这个:
=IIf(First(Fields!CustomerCountry.Value, "Invoice")<>(First(Fields!SupplierCountry.Value, "Invoice")),0,((SUM(Fields!DurationHours.Value * Fields!HourlyRate.Value))*0.21))
只记得保持简单然后构建。
从类似下面的内容开始:
我正在尝试制作自动发票,但最后一部分让我卡住了。如果客户与供应商不是来自同一个国家,那么他不应该支付增值税。为了在我的发票中得到这个,我试图插入一个表达式,但它给出了以下错误:
'The Value expression for the textrun ‘Textbox16.Paragraphs[0].TextRuns[1]’ contains an error: [BC30455] Argument not specified for parameter 'FalsePart' of 'Public Function IIf(Expression As Boolean, TruePart As Object, FalsePart As Object) As Object'.'
这是我使用的表达式:
=IIf(First(Fields!CustomerCountry.Value, "Invoice"))<>(First(Fields!SupplierCountry.Value, "Invoice")),0,((SUM(Fields!DurationHours.Value * Fields!HourlyRate.Value))*0.21)
有人可以帮忙吗?
提前致谢
您的 iif 语句中第一个 First
函数处有一个额外的括号。试试这个:
=IIf(First(Fields!CustomerCountry.Value, "Invoice")<>(First(Fields!SupplierCountry.Value, "Invoice")),0,((SUM(Fields!DurationHours.Value * Fields!HourlyRate.Value))*0.21))
只记得保持简单然后构建。
从类似下面的内容开始: