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 Chris Miller on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

Text Message When No Records Are Returned

Status
Not open for further replies.

mwake

Programmer
Feb 12, 2004
151
US
I'm using CR2008 with an Oracle db as my data source. One of the requirements for the reports I'm developing is to display a text message saying "No Records Found" when a query returns no records. I need a formula that will print the text if no records are found, but suppress if any records are returned. I tried using a count, but it didn't work because no count is created if no records are found. Can anyone give me a formula for this??
 
mwake,

I do not have crystal in front of my at the moment, but perhaps something like:
Code:
IF IsNull({ReportField}) THEN "No Records Returned" ELSE ""

Use on a field that is guaranteed to be populated for all records, else if the last record of the report happened to have a null - the text would still display.

Hope this helps!

Mike
---------------------------------------------------------------
"To be alive is to revel in the moments, in the sunrise and the sunset, in the sudden and brief episodes of love and adventure,
in the hours of companionship. It is, most of all, to never be paralyzed by your fears of a future that no one can foretell."
 
Hi,
Another technique would be to insert a text box in the details section and have the text read "No Data Returned" or something, and you could even format the text box with colored text and background color - then set a suppression formula for the box :

NOT IsNull({Table.Field})


[profile]

To Paraphrase:"The Help you get is proportional to the Help you give.."
 
I tried both "IsNull" solutions but they didn't work. I'm not saving data with the report. Could that be the problem?? I tried dropping a text box into the detail section of a blank report and it does not appear.
 
Go into file->report options and make sure that you have not checked "suppress printing if no data" (or something like that).

-LB
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top