on 2020 Apr 02 10:59 PM
Hi,
I'm quite new to Crystal Reports and I'm stuck, hoping someone here can help me.
I have a report that where I want to print the address to where we shipped our orders. I have four different fields where there can be information about shipping address.
ordlevadr2 (first prio) - if there is data in this field always use that one
ftgpostadr5 (second prio) - if ordlevadr2 is empty look if there is any value here, use this one
ftgpostadr2 (third prio) - if ordlevard2 and ftgpostadr5 is empty and there is a value in this field, use this one
ftgpostadr4 (last prio) - if ordlevadr2, ftgpostadr5 and ftgpostadr2 is empty use this one
if all of the fields are empty set text 'none'
I have tried with below code, but I can't get it right
if ISNULL({q_import_tableu;1.ordlevadr2}) then ( if ISNULL({q_import_tableu;1.ftgpostadr2}) then {q_import_tableu;1.ftgpostadr5} else if ISNULL({q_import_tableu;1.ftgpostadr5}) then {q_import_tableu;1.ftgpostadr2} else if ISNULL({q_import_tableu;1.ftgpostadr4}) then {q_import_tableu;1.ftgpostadr5} else 'none'; ) else {q_import_tableu;1.ordlevadr2}+' '+{q_import_tableu;1.ordlevadr3}
Help others by sharing your knowledge.
AnswerRequest clarification before answering.
Try:
if not (ISNULL({q_import_tableu;1.ordlevadr2}) or ({q_import_tableu;1.ordlevadr2}="")
then
{q_import_tableu;1.ordlevadr2}
else
if not (ISNULL({q_import_tableu;1.ftgpostadr5}) or ({q_import_tableu;1.ftgpostadr5}="")
then
{q_import_tableu;1.ftgpostadr5}
else
if not (ISNULL({q_import_tableu;1.ftgpostadr2}) or ({q_import_tableu;1.ftgpostadr2}="")
then
q_import_tableu;1.ftgpostadr2}
else
if not (ISNULL({q_import_tableu;1.ftgpostadr4}) or ({q_import_tableu;1.ftgpostadr4}="")
then
{q_import_tableu;1.ftgpostadr4}
else "none"
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
Hi
You can do in another way, useing IIF statement
IIF ( conditon1 ," " ,
condition2, " " ,
condition3 , '' ,
condition4 , "",
condition5 , "" , nonevalue) ).
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.
| User | Count |
|---|---|
| 15 | |
| 9 | |
| 6 | |
| 4 | |
| 4 | |
| 4 | |
| 3 | |
| 2 | |
| 2 | |
| 2 |
You must be a registered user to add a comment. If you've already registered, sign in. Otherwise, register and sign in.