Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations SkipVought on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Want to Display that No Data was found

Status
Not open for further replies.

suzq2

MIS
Oct 3, 2003
10
0
0
US
I have written my report which has a open date & end time that I am prompting the client for. When it finds an incident in that time frame, it displays it on the report along with header information; but, when it doesn't find any data, it doesn't display anything under the titles. I would like the report to display "No Data Found". I have the report doing a count on # of Incidents found and it only displays when there is an incident found. I have written formulas to say if isnull ({@CountIncidents}) then "No Incidents Found" but nothing displays. What am I doing wrong? Thanks. Suzq2
 
Try this:
Code:
if {@CountIncidents} = 0 then 
    "No Incidents Found" 
else
    ""

You formula may never be null since it is doing a count.

~Brian
 
You need to consider the weirdo way that Crystal handles null values. Most times, Crystal will simply stop working when it is comparing a null field with a known value. For instance, if your formula was like:
if (TABLE.FIELD = 0) then blah blah

If TABLE.FIELD was null, this formula would simply stop. The then portion of your formula is never executed. If you think about it, that is true, because 0 is not null. It sounds like your count of Incidents is behaving exactly the way it should, given Crystal's handling of Null values.

Can you give a little more info regarding your formulas and the setup of the report?
 
Thanks for responding. I had already tried the if {@CountIncidents} = 0 then "No Incidents Found" and nothing still displays on the report but the titles. suzq2
 
I use a similar situation on all my reports.
Make a sub section and drop in a text field with "No Data Found".
Then conditionally suppress the section by picking up the one of the main fields that would normally be displayed such as Incident Number or open date - you may need to try a couple.
Code: not isnull(incident-Number)

This shows the section only when there this value is null

Tommorrow
 
Thanks, Tommorrow, that worked great!!! Suzq2
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top