Solved

Crystal Formula-Null values

Posted on 2013-05-16
2
487 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

Networking for the Cloud Era

Join Microsoft and Riverbed for a discussion and demonstration of enhancements to SteelConnect:
-One-click orchestration and cloud connectivity in Azure environments
-Tight integration of SD-WAN and WAN optimization capabilities
-Scalability and resiliency equal to a data center

Question has a verified solution.

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

I hate sub reports and always consider them the last resort in any reporting solution.  The negative effect on performance and maintainability is just not worth the easy ride they give the report writer.  Nine times out of ten reporting requirements…
There have always been a lot of questions related to when Crystal Reports evaluates report components (such as formulas, summaries, cross-tabs, charts, to name a few examples). Crystal Reports uses a two-pass reporting process to provide greater …
Microsoft Active Directory, the widely used IT infrastructure, is known for its high risk of credential theft. The best way to test your Active Directory’s vulnerabilities to pass-the-ticket, pass-the-hash, privilege escalation, and malware attacks …
Established in 1997, Technology Architects has become one of the most reputable technology solutions companies in the country. TA have been providing businesses with cost effective state-of-the-art solutions and unparalleled service that is designed…

860 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