all groups > sql server reporting services > january 2005 >
You're in the

sql server reporting services

group:

Data driven subscription: if no report data => do not deliver


Data driven subscription: if no report data => do not deliver david boardman
1/31/2005 12:39:03 PM
sql server reporting services: I am wondering if there is a simple way to tell the report server to not
deliver a report if there is no data in the report.

I have several reports which have table layout to display a set of data IF
there happens to be data. One example is that I have a polling process
looking at certain tables in SQL Server every 10 minutes. Is there a quick
way to not send me an e-mail if there isn't data to look at?

Thanks!
Re: Data driven subscription: if no report data => do not deliver Daniel Reib [MSFT]
1/31/2005 2:04:38 PM
Currently there is not, although this feature has been requested several
times. The only way to do it now is to construct the Data Driven
Subscriptions query to return no rows when the report will return no rows.

--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

RE: Data driven subscription: if no report data => do not deliver eralper
2/1/2005 7:39:08 AM
Hi,

I have a similar data-driven subscription. The first query determines the
receivers for email, the second query prepares the email content for the
corresponding receiver.

So as Daniel wrote, first I had to eliminate no-data records then run the
query for the remaining set.



[quoted text, click to view]
RE: Data driven subscription: if no report data => do not deliver david boardman
2/1/2005 10:27:03 AM
I guess I can post my interim solution for those looking to at least have
something working. I just am looking for a more elegant/built in solution.

For data-driven subscriptions, RS requires you to specify an SQL query which
returns data to the subscription (things like what e-mails to send to, and
what parameters to pass to the actual report, if any). I exec a stor proc in
order to return this information back to my subscription. The key lies in
the stor proc being called.

The stor proc which feeds the data driven subscription ends up calling the
stor proc which returns data for the report (which in reality is completely
compartmentalized from the subscription itself). The subscription proc
checks to see if at least 1 row of data is returned by the report proc. If
the report stor proc returns no data, then the subscription stor proc returns
a NULL SET back for the e-mail addresses to deliver the report to.

I don't know if I'm capitalizing on a bug or not, but there is no error
generated in the log files. I guess the report is actually generated (with
no data) and delivered into never-never land.

Hope I explained what I'm doing clearly, but just wanted people to know
there is an interim solution, although some what cludgy.

Cheers!

[quoted text, click to view]
Re: Data driven subscription: if no report data => do not deliver Daniel Reib [MSFT]
2/1/2005 4:55:53 PM
This is by design from the perspective of RS. If the query used to generate
the notifications returns no rows then the report will not be run for that
instance of the subscription until the next time it fires and the query
returns data.

--
-Daniel
This posting is provided "AS IS" with no warranties, and confers no rights.


[quoted text, click to view]

AddThis Social Bookmark Button