Click here to Skip to main content
15,908,775 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
Hello everyone...

I have sql server table like
ID   R1       R2
--------------------
1  1100.50   550.30
2  NULL      980.20
1  1200.75   620.00
2  NULL     1030.31

I want to display some user defined string in crystal report if value for R1 or R2 column is NULL.
for example: for ID 2 R1 = NULL
so, I want to display "NA" or "Not in use"

What I have tried:

I tried following formula in Format Object --> display string option of R1 report field
if isnull({PP_credit_sale.R1}) then
    "NA"
else
    Cstr({PP_credit_sale.R1})


But it displays Blank Field.

Can anybody help me on this? How can I achieve this? is it possible for decimal field?
Posted
Updated 26-Jan-17 21:22pm

1 solution

try this might work
if Cstr({PP_credit_sale.R1})="NULL" then
"NA"
else
Cstr({PP_credit_sale.R1})
 
Share this answer
 
v2

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900