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!

Suppressing sections on empty reports 2

Status
Not open for further replies.

bardley

Programmer
May 8, 2001
121
0
0
US
I am using CR8.5 and have created a report that I want to refresh and run daily, with data from the previous day. Sometimes this report will contain no records. When there are no records, my group footers still print, as do my report header and footer. I have a summary formula in my report header and footer (the same formula) that displays the number of records. I have tried conditionally suppressing all the sections I don't want by testing if this is 0, but it doesn't work.
Ideally, if records are present, I wish to print the report as it is. If there are none, I wish to print a "Report Header B" with a static message saying there were no records that day. I have created the report headers, but they both print when there are no records.
Thanks in Advance for any help.
 
If there are no records for that day, your total will not be 0, but will be NULL. So you should supress your Report Header A (normal header) if your total formula is NULL and suppress your Report Header B (static text saying there were no records) if your total formula is not NULL.

Header A should have something like this in the supress box :

ISNULL(@TotalRecords) = TRUE

Header B:
ISNULL(@TotalRecords) = FALSE
 
Depending on how your formula @TotalRecords is structured, you may not get a null value.
For example, if I put in the record selection formula
0 = 1
then this is always false, so no records are returned. I run the report, and it shows 0 records. I put in the field RecordNumber, and it shows 1 for a value. A bit odd.
A more reliable way to suppress sections is to choose a field that never contains a null value, such as an ID field or an index field. Then, use the formula that Further suggested with that. This field will always behave consistently, regardless of how you have Crystal Reports configured. Malcolm
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top