I was trying to filter the data in database with the following formula in my crystal report and one of the condition is to included the data even this, '{vw_CandidateProfile.Type}' is null or empty string. But the formula below doesn't work. Any ideas?
{vw_CandidateProfile.Candidate_Code} = '881225095228'
AND (
{vw_CandidateProfile.Type} IN ['NGO','EDU','PRS','PPR','PPS','TTL','OTH']
OR ISNULL({vw_CandidateProfile.Type})
)
IIF and IsNull are functions in Crystal Reports that are used in formulas to test fields for blanks, empty strings, missing values and NULL, then return some valid output. This is especially helpful when preparing a report, since these values can cause blank lines to be printed.
To ensure the formula is always evaluated when there is null data, always use the function: IsNull, as the first comparison for the database field. An alternative to using the function IsNull in a formula is to check the report option "Convert Database NULL Values to Default".
If value isn't null, your code should put it into the shared variable. If it is null, your code can safely ignore it and do nothing.
I have found the solution in which the IsNull() field has to comes before the field which is no IsNull().
{vw_CandidateProfile.Type} IN ['NGO','EDU','PRS','PPR','PPS','TTL','OTH']
OR ISNULL({vw_CandidateProfile.Type})
becomes
ISNULL({vw_CandidateProfile.Type})
OR {vw_CandidateProfile.Type} IN ['NGO','EDU','PRS','PPR','PPS','TTL','OTH']
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With