Solved

Crystal Formula-Null values

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

IT, Stop Being Called Into Every Meeting

Highfive is so simple that setting up every meeting room takes just minutes and every employee will be able to start or join a call from any room with ease. Never be called into a meeting just to get it started again. This is how video conferencing should work!

Join & Write a Comment

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. …
Hello everyone, Hope you find this as helpful as we did. We have on the company I work for an application built in Delphi V with Crystal Reports 8. We all know that Crystal & Delphi can be temperamental sometimes and the worst thing is, nearly…
Get a first impression of how PRTG looks and learn how it works.   This video is a short introduction to PRTG, as an initial overview or as a quick start for new PRTG users.
You have products, that come in variants and want to set different prices for them? Watch this micro tutorial that describes how to configure prices for Magento super attributes. Assigning simple products to configurable: We assigned simple products…

757 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

20 Experts available now in Live!

Get 1:1 Help Now