Crystal report if then help, how to return a string or variable with formula

自闭症网瘾萝莉.ら 提交于 2019-12-07 12:10:59

问题


Relatively new to crystal and I've hit a bit of a snag with a formula.

I'm trying to create a formula that will report out when an RMA was received and how many. If none of the items have been received, I want it to show a message stating such, but if items from the RMA have been received I want it to return the receipt number.

Since a picture is worth a thousands words...

Current report view

I tried using an if then but I don't think you can combine strings with BAQReportResult values.

if {BAQReportResult.RMARcpt.OurReceivedQty}>0 then {BAQReportResult.RMARcpt.RMAReceipt}

After that I tried a variety of else statements but stuck here I am...

Any help is greatly appreciated!


回答1:


I think you must declare a string type and then assign the value in else part.

Create a Formula and place in the Report, what has to be written in formula will be like:

stringvar text:="";
if {BAQReportResult.RMARcpt.OurReceivedQty}>0 then 
text="{BAQReportResult.RMARcpt.RMAReceipt}"
else
text="There are ..."


来源:https://stackoverflow.com/questions/19684874/crystal-report-if-then-help-how-to-return-a-string-or-variable-with-formula

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!