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

Print "No Records found" Report for Empty Cursor Table

Status
Not open for further replies.

rooship

IS-IT--Management
Jun 25, 2003
20
Hello,
I am trying to print a report with "No records found" message if the cursor is empty. I searched the forum, and found a few suggestions to create a seperate report.
Is there anyway that I can use the same report to print the message "No records found" in the summary band?

Thanks for your help,
Rooshi
 

Rooshi,

Before starting the report, create a public or private variable, like this:

PRIVATE NoRecFound
NoRecFound = (RECCOUNT("MyTable") = 0)

In the report, for each item in the Details and Group header / footer bands, go to Properties / Print When. In the "Print only when an expression is true" box, enter the expression

NOT NoRecFound

These items will then be suppressed when the report is empty.

Finally, add your "No records found" message to the summary band, and set its "Print only when an expression is true" to the opposite of the above, that is:

NoRecFound

I haven't tested this -- it's just off the top of my head. But it should put you on the right track.

Mike


__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Hi Rooshi,

I don't believe the Report Writer will print anything at all if its input table is empty. I think you may be stuck with some sort of 2 report solution or with creating some sort of recognizable dummy record to send to the report.

Jim
 

Jim,

I don't believe the Report Writer will print anything at all if its input table is empty.

Come to think of it, I think you're right. I had in mind that it would still print text objects, but I on reflection it probably won't.

Mike

__________________________________
Mike Lewis (Edinburgh, Scotland)

My sites:
Visual FoxPro (www.ml-consult.demon.co.uk)
Crystal Reports (www.ml-crystal.com)
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top