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

Run report that finds no data. How can you be sure report worked? 1

Status
Not open for further replies.

mjm19

Technical User
Apr 22, 2003
33
US
Is there a formula out there that tells a user upon completion of a report that it did indeed search the database, but found nothing that qualified for the report.
Need to run a daily report that rarely finds data, but when it does, needs to be acted upon immediately. Regulatory issues have come up where I need to defend that a search was done via a message on the report itself from the Crystal formula.
We have Crystal v8.0 and 8.5.
Thanks for any input ....

Mike
 
Can you not verify that the report is doing what it's supposed to by looking at the SQL it generates? (Database menu/Show SQL)

Naith
 
Naith,
Yes I can do that, but not good for users who look at the completed, mostly "blank" report. I recently took a Crystal Report Design 8.5 course where the Instructor showed us how a message could be generated via a formula when the report did successfully read the database, and found nothing to qualify for it. Of course I thought that it was of know use at the time, but now I'm being asked to come up with something as proof on the report. We are a huge networked Enterprise here, and this report prints out miles away from where I'm at.

Thanks for your help,

Mike
Boston, Ma.
 
I think the technique your instructor showed you was how to return a message when no records are returned. If there is no database connection for the report, it'll just fall over.

In your report header, place a formula that says simply:

Count({KeyField})

In the place of KeyField, place a core field to the report. i.e. an id or something. Something which the report MUST contain if it were to return data.

Right click the report header, and insert a new section. In this section, place a text box containing your chosen message for when the report contains no data.

Conditionally suppress this new section with the following details:

Not IsNull(Count({KeyField}))

This will suppress the section when there are KeyField values, but when there aren't, the section and it's message will be displayed.

Naith
 
Insert a "Text Object" saying "No Records Found" and set its Suppress attribute to:
-----------------------------------------
Not(Isnull(Count({some_Field}))) or
Count({some_Field}) > 0
-----------------------------------------

Cheers,
- Ido

CUT, Visual CUT, and DataLink Viewer:
view, e-mail, export, burst, distribute, and schedule Crystal Reports.
 
Thanks Naith ... you've saved my neck. This is exactly what I need to do.

Mike
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top