Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

If null then else in QR code -help

Status
Not open for further replies.

seekingandomeda

Technical User
Mar 1, 2013
2
US
QR Code and If Null Then Else

New to Crystal Reports and formulas. Added ID Automation in to the mix to generate QR code within a Crystal Report. QR code works and was able to preview in Crystal Reports with the basic formula in line 1 of the QR code:
stringVar DataToEncode:= {Field 1} & {Field 2} & {field 3} & "Vendor ID 11111111";

I need some help with altering line 1 of the formula to say: if there is no data in (field 1) then leave blank.

My attempt below shows no errors within Crystal Reports, but it also shows no QR code when previewed. Any help greatly appreciated.

stringVar DataToEncode:= {Field 1} & if {Field 2}= "a,b,c" then "a,b,c" else "no" & {Field 3} & "Vendor ID 11111111";
stringVar CompleteBarcodeString:="";
numberVar i:=0;
numberVar Segments:= IDAutomationQRCodeEncoderQRSet(DataToEncode,0 ,0 ,0 ,0 );
For i:=0 to Segments Do
(
CompleteBarcodeString := CompleteBarcodeString + IDAutomationQRCodeEncoderQRGet(i);
);
CompleteBarcodeString
 
I figured it out. Just need to change "Exceptions for Nulls" to "Default Values For Nulls".
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top