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

crystal-reports-2010if statement

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!

Best Answer

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 ..."
Related Topic