SSRS v2005 - Data-driven subscription don't send Email If No Rows

  • I have a data driven subscription set up which works fine and sends an email which includes an Excel rendering of a report that's based on the contents of a table that's populated daily. If there are no rows in the table, I would like for the email to not be sent to the users.

    Is there any way to do this?

  • In my experience this is one of the drawbacks of the data-driven subscription as there is no way to specify that if the report has no rows don't send the email. Someone may have a work around for this though. For regular subscriptions I have done a separate job that checks for data, then calls sp_start_job to execute the job that runs the report. I don't know if that would work with a data-driven subscription though.

    There have been other threads here on SSC where other people have suggested work arounds for subscriptions, but I don't recall if they included data-driven subscriptions.

  • Actually, if you set up the query in your subscription to return the email addresses you want to send out to, and set it up so it returns nothing when you have no data, then it will not send the email. In your To: field, select "speficy a value from database" and use the results of that query.

  • Actually, if you set up the query in your subscription to return the email addresses you want to send out to, and set it up so it returns nothing when you have no data, then it will not send the email. In your To: field, select "speficy a value from database" and use the results of that query.

    From what I can tell, your idea results in an empty report that IS sent in an email.

    If I'm wrong, please detail how you avoid getting an empty report using only the DDS.

    Thanks,

    Keith

Viewing 4 posts - 1 through 3 (of 3 total)

You must be logged in to reply to this topic. Login to reply