Solved

Crystal Formula-Null values

Posted on 2013-05-16
2
482 Views
Last Modified: 2013-05-28
Hello all,
I have a crystal formula as below:
When any one of the field is null the report doesnt display data.How can I rewrite or handle this.
{Patients.NsID}+ " / " +{Patients.Room} +" / "+{Patients.Bed}

Open in new window

0
Comment
Question by:Star79
2 Comments
 
LVL 100

Assisted Solution

by:mlmcc
mlmcc earned 250 total points
ID: 39173015
Try this

Local StringVar strOutput;
If Not IsNull({Patients.NsID}) Then
    strOutput := {Patients.NsID} + " / "
Else
    strOutput  := " / ";

If Not IsNull({Patients.Room}) Then
    strOutput  := strOutput  + {Patients.Room} + " / "
Else
    strOutput  := strOutput  + " / ";

If Not IsNull({Patients.Bed}) Then
    strOutput  := strOutput  + {Patients.Bed};

strOutput

Open in new window


mlmcc
0
 
LVL 34

Accepted Solution

by:
James0628 earned 250 total points
ID: 39174281
You could also go to File > "Report Options" and check the "Convert database null values to default" option and a null field will be replaced by an empty string.  That option will effect almost every formula in a report, so if you actually need to see nulls in some formulas, you may not want to use that option.

 More recent versions of CR also include an option in the formula editor to control how that specific formula treats nulls, so you could see if you have that option.

 James
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Crystal Reports: 5 Tests for Top Performance It is complete, your masterpiece report.  Not only does it meet your customer’s expectations, it blows them out the water, all they want is beautifully summarised and displayed in a myriad of ways. …
Hot fix for .Net Crystal Reports 10.2.3600.0 to fix problems with sub reports running on 64 bit operating systems ISSUE: Reports which contain subreports fail with error "Missing Parameter Value" DEPLOYMENT SERVER OS: Windows 2008 with 64 bi…
Concerto provides fully managed cloud services and the expertise to provide an easy and reliable route to the cloud. Our best-in-class solutions help you address the toughest IT challenges, find new efficiencies and deliver the best application expe…
Delivering innovative fully-managed cloud services for mission-critical applications requires expertise in multiple areas plus vision and commitment. Meet a few of the people behind the quality services of Concerto.

932 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

19 Experts available now in Live!

Get 1:1 Help Now