×
INTELLIGENT WORK FORUMS
FOR COMPUTER PROFESSIONALS

Contact US

Log In

Come Join Us!

Are you a
Computer / IT professional?
Join Tek-Tips Forums!
  • Talk With Other Members
  • Be Notified Of Responses
    To Your Posts
  • Keyword Search
  • One-Click Access To Your
    Favorite Forums
  • Automated Signatures
    On Your Posts
  • Best Of All, It's Free!

*Tek-Tips's functionality depends on members receiving e-mail. By joining you are opting in to receive e-mail.

Posting Guidelines

Promoting, selling, recruiting, coursework and thesis posting is forbidden.

Students Click Here

Do not want to email if there are no records

Do not want to email if there are no records

Do not want to email if there are no records

(OP)
I have a dilemma that I'm not sure how to resolve.  I want to send up a recurring report that will email out a report if a payment has been made that day for a vendor.  I know how to write the report but I don't want to send a blank report out if no payments were made that day.  Does anyone out there know how to prevent the email from being sent if there is no data to report?

Regards,
Bessebo

RE: Do not want to email if there are no records

The only way I you can achieve this is to force your report to fail over when there are no records.

In your report header, place a formula which will only cause an error when the report is empty. Like:

If IsNull(Count({Table.ID}))
Then 1/0
Else 1/1

Suppress the formula and stick it anywhere in your report.

You will have to be careful, of course, that you do not overlook genuine failures which return something other than Division by Zero errors.

Naith

RE: Do not want to email if there are no records

(OP)
Naith,
 Does the field {Table.ID} refer to a system field that I am unaware of or is this supposed to refer to a field within my data schema? Or should I be able to use it verbatum as you wrote it?

The formula that you wrote was  
  If IsNull(Count({Table.ID}))
      Then 1/0
  Else 1/1

I assume that as a result of this formula returning 1/0 if there are no records found then it will result in a failed instance?

Regards,
Bessebo

RE: Do not want to email if there are no records

Generally, if a poster makes a vague reference in curly brackets like {Table.ID}, it's because we don't know what your appropriate field from your schema should be. The idea is that you would replace it with the most important field in your report.

If there is no data, the formula will attempt to exit on 1/0 - which will make the report fail because, as you're aware, you cannot divide an integer by zero.

As the report fails, an email will not be generated.

Naith

RE: Do not want to email if there are no records

(OP)
Naith,
  Thanks for the suggestion but I just tested what you suggested and an email is generated and a successful instance is generated. If I click on the attachment that is emailed it brings me into the report in the Info Analyzer with a Division by Zero error.
  Also, if I go to Seagate Info and double click on the successful instance it give me the following message (too bad I cannot attach a screenshot):

Crystal Smart Viewer
    PEEncapsulatePage : Error in formula <NullData>.
    If IsNull(Count({armaster.customer_code}))
    '
    Division by Zero

Does this work in your environment?

Regards,
Bessebo

RE: Do not want to email if there are no records

I don't operate a SI environment anymore, but I have used this in the past, and I know it works.

I am somewhat confused by the fact that you say your desktop generates a "successful" instance despite the fact that when you attempt to view the report, you can see that the instance has unequivocally failed.

Where have you positioned the formula?

Naith

RE: Do not want to email if there are no records

(OP)
I put the formula in the header and suppressed it by using the format editor on the common tab I checked Suppress. I assume you meant that and not Suppress if Zero on the Number tab of the format editor.

Maybe I should move the formula into the detail section?  Any other suggestions would be appreciated.

Regards,
Bessebo

RE: Do not want to email if there are no records

Try removing that formula and placing this in the conditional suppression of the Report Header:

1/Count({armaster.customer_code}) > 0

Naith

RE: Do not want to email if there are no records

(OP)
Naith,
  I'm a little confused when  you say "in the conditional suppression of the Report Header". I moved it into the Report Header and suppressed it.  Now it doesn't even generate an error.

Regards,
Bessebo

RE: Do not want to email if there are no records

(OP)
I put the formula you gave me in the first X+2 button under the Format Section (next to Suppress No Drill Down) for the Report Header.  Hopefully that was the correct place.  It still runs successfully.  Still no luck...

Thanks,
Bob

Red Flag This Post

Please let us know here why this post is inappropriate. Reasons such as off-topic, duplicates, flames, illegal, vulgar, or students posting their homework.

Red Flag Submitted

Thank you for helping keep Tek-Tips Forums free from inappropriate posts.
The Tek-Tips staff will check this out and take appropriate action.

Reply To This Thread

Posting in the Tek-Tips forums is a member-only feature.

Click Here to join Tek-Tips and talk with other members! Already a Member? Login

Close Box

Join Tek-Tips® Today!

Join your peers on the Internet's largest technical computer professional community.
It's easy to join and it's free.

Here's Why Members Love Tek-Tips Forums:

Register now while it's still free!

Already a member? Close this window and log in.

Join Us             Close