文本对象中的Crystal Reports公式



我是公式的新手,正在与一些东西作斗争。到目前为止,我已经知道了:

if {tblcustomer.vat_reseller} = 0 
then VAT: {tblinvoices.vat_multiplier}*100 %
else 
if {tblcustomer.vat_reseller} = 1 
then Reverse charge: Customer to pay the VAT to HMRC

没有发现错误,但显示:

"VAT:{tblinvoices.VAT_multiplier}*100%"而不是"VAT:20%"或"反向收费:客户向HMRC支付增值税"

抱歉,这可能是一个简单的修复方法(希望如此!),但当我尝试调整语法时,它开始给我其他错误,如a number is required等。

引号中的值被视为文字字符串。

要在字符串中获得{tblinvoices.vat_multiplier}乘以100的值,需要将其转换为字符串,然后将其连接到字符串的其余部分中,如下所示:

if {tblcustomer.vat_reseller} = 0 
    then "VAT: " & CStr({tblinvoices.vat_multiplier}*100) & " %"
else if {tblcustomer.vat_reseller} = 1 
    then "Reverse charge: Customer to pay the VAT to HMRC"

最新更新