Posts Tagged ‘Data Subscription’

How to Suppress Sending Empty Reports in Data-Drive Subscription

March 9, 2016 Leave a comment

I got this question from MSDN, Click here for original question

Question in brief :-

We have a data-driven subscription that is emailing reports to people (parameters for the report and the email address for recipients are returned by the data-driven query).  How can we make it so that if a report is empty, the email is not sent?

Let say your report is based on employee table.

So Dataset query :-

select * from DimEmployee

And data driven subscription query is:-

select '' Emailid

Then you need to modify the data driven subscription to include the count of rows from the report query .

I modified above data driven subscription like below SQL query:-

select '' Emailid 
where 1 <=(select count(1)numberrecords from DimEmployee)

So when there is no result from main SQL query then data driven query also will not give any row.

I have created Video in detail to show how it works.


Learn Different BI Tools
Subscribe my YouTube Channel : Know BI Tools

Categories: Home, MSDN, SSRS Tags: , ,