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] "eralper" wrote:
> 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.
>
>
>
> "david boardman" wrote:
>
> > 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!