我在水晶报告中使用了以下公式:
ToText(ToNumber({INVOICE.ORDER_ID}),0,"")&"-"&
ToText(ToNumber({INVOICE.INVOICE_ID}),0)&"-
"&ToText(ToNumber({PACKAGE.PACKAGE_ID}),0)
如果包不存在,我需要它才能显示订单和发票。 我尝试了以下内容:
IFNULL({PACKAGE.PACKAGE_ID} then
ToText(ToNumber({INVOICE.ORDER_ID}),0,"")&"-"&
ToText(ToNumber({INVOICE.INVOICE_ID}),0)
else
ToText(ToNumber({INVOICE.ORDER_ID}),0,"")&"-"&
ToText(ToNumber({INVOICE.INVOICE_ID}),0)&"-
"&ToText(ToNumber({PACKAGE.PACKAGE_ID}),0)
我收到一个错误:“文本的其余部分不是公式的一部分”,它突出了整个声明。
我相信我很接近,但似乎无法弄清楚这一点。我对水晶报道比较陌生,所以任何建议的人都会非常感激!
答案 0 :(得分:1)
IF ISNULL({PACKAGE.PACKAGE_ID}) then
ToText(ToNumber({INVOICE.ORDER_ID}),0,"")&"-"&
ToText(ToNumber({INVOICE.INVOICE_ID}),0)
else
ToText(ToNumber({INVOICE.ORDER_ID}),0,"")&"-"&
ToText(ToNumber({INVOICE.INVOICE_ID}),0)&"-
"&ToText(ToNumber({PACKAGE.PACKAGE_ID}),0)