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

Display Message When No Records Returned

Status
Not open for further replies.

CEG

Technical User
Feb 13, 2002
22
0
0
GB
Having designed a Crystal Report, my users would like to see a message displayed, rather than a blank sheet of paper. I have put in formulae in Headers & Footers, to no avail. The rest of the report works very well.
Thanking you in anticipation for your help in this dilemma
CEG
 
First, create a text box with your message of choice and place it in the report header (assuming that the header is not suppressed).

Next, conditionally suppress the text with a count formula such as:

Count({table.field_of_choice}) > 0

The text box will only be visible if there are zero records.
 
see crystal kbase article c2005590
for step by step instructions on how to do this...

lmc
cryerlisa@hotmail.com
 
Thanks, but neither of these have worked.
 
it should work - is something else going on that may be causing the problem? is this a main report or a subreport that you are working with? Ive done this many times over the years and it has worked well for me.

send me more info - what version of crystal? whats your backend? copy and paste your formulas. I ll try to help

lmc
cryerlisa@hotmail.com
 
Essentially the report uses the Nominal Ledger, and is grouped by a Category name, showing last 12 process periods in columns.
The detail is suppressed. Only Group Hdrs & Ftrs showing values are displayed in rows. I have put the Category name as the count field.The back end is Sql 2000. The requirement was that if the nominal ledger had not been closed for a period,then the report should not be displayed. The select criteria I used was Nom Period > Select Period. The NL is in 10, if the select period = 10, then zero records selected. It would be great if I could send you the formulae but it is a creation worthy of Rembrandt.
Thanking you
CEG
 
Try ISNULL(Count({table.field}))

If there are no records in the report the count is NULL, and not zero as you might expect.

"Convert NULL to default" does not change this behaviour. Editor and Publisher of Crystal Clear
 
If I understand the question properly, here is what I do for all my reports when I have no data returned by the report. I just create a text box with a proper message and conditionaly suppress the the text box by writing this code
'not isnull(primaryKey value of your table)'. To do this right click your text box, then format text and enter the code. Your message will be shown when the report dosen't return any values.

Thanks,
Hamida
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top