Link to home
Start Free TrialLog in
Avatar of KSUF
KSUFFlag for United States of America

asked on

Chrystal report expression

The following expression does not return any data after the giftnote. I been making subtle changes and trying different things, but can't get it to work. I have set default values for nulls. I have tried with and without else.

"Gift designation: " + {FUND.FUND_TITLE}+ " (Fund number: " + {GIFT.FUND_ACCT} + ")"
+ chrw(13) + chrw(10)
+ if {@GiftNote} > "" then "Gift Note: " + {@GiftNote} + chrw(13) + chrw(10) else ""
& if sum({GIFT.PREM_VAL})>0 then "Premium Value: $" + cstr(sum({GIFT.PREM_VAL})) & chrw(13) & chrw(10) else ""
& if {WILL.CSV}>0 then "Charitable Deduction: $" & cstr({WILL.CSV} )else ""
Avatar of _TAD_
_TAD_

Personally I always found it a bit easier to use IIF.   It doesn't change the logic, but I always found it easier to read (and I never lost a parenthesis.

Also, I see that you switch between + and &.  You will want to stay consistent

+ IIF( {@GiftNote} > " ", "Gift Note: " + {@GiftNote} + chrw(13) + chrw(10) , " ")
+ IIF( sum({GIFT.PREM_VAL})>0,  "Premium Value: $" + cstr(sum({GIFT.PREM_VAL})) + chrw(13) + chrw(10), " ")
+ IIF( {WILL.CSV}>0, "Charitable Deduction: $" & cstr({WILL.CSV} ) , " ")
ASKER CERTIFIED SOLUTION
Avatar of Mike McCracken
Mike McCracken

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial
Avatar of KSUF

ASKER

Thank you! I've been fighting this for hours...so simple...wish I'd have thought of it.