Data driven schedule with Reporting Services subscribed report

  • Hi! I know it's possible to have a data-driven subscription in Reporting Services, but I'm looking for a way to have a data-driven schedule. Every month I send out some reports, but can only have these sent out once other data has been updated. Is there any way that I can trigger the subscription schedule based on queried data? Thanks!

  • This should help get you there.

    http://www.sqlservercentral.com/articles/Development/2824/

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg
  • create a trigger which is considered to be the primary source for pulling the data to your report. This should be identical.

    check for the examples of creating trigger to the above mentioned through google.. etc....

  • You can use the data-driven subscriptions for this. If your email list for the subscription does not return any results, no reports will be sent.

    So, you can create a data-driven subscription using something like:

    IF EXISTS(SELECT * FROM MyData)

    SELECT MyEmail, MyUserName FROM DistributionList

    ELSE

    SELECT TOP 0 MyEmail, MyUserName FROM DistributionList

    This will prevent the subscription from running if the data is not ready. This is not event-driven, but if you want the reports to run every night only if there is data, this works well.

  • Thanks for the good advice! I think I'll go with Michael Earl's suggestion, since that would work nicely for my needs.

  • I cannot remember if the conditional works though.

    If it cares that it is just a select statement, you may have to write it more like:

    SELECT MyEmail, MyName

    FROM MyUserList

    WHERE MyReport = 'Report1'

    AND EXISTS(SELECT TOP 1 * FROM MyData)

    The query is less-than-efficient, but it works with the data-driven report structure.

  • Has anyone tried to do a data driven schedule?

    For example, I have a client who decided that they want a report delivered on the first Tuesday of each fiscal month. I have the fiscal month start and end dates in a table and I wrote a query that will always return the date value for the first Tuesday of the fiscal month. Reporting services, however, does not natively allow for that type of schedule. Any ideas how to get the schedule to deliver on the date returned from a query?

  • Check the article I referenced above.

    Follow the instructions and create a subscription that will never run (set its run date to the past). It also explains how to get the job id (subscription/schedule id). Using that, you can execute the job (subscription) as needed via code.

    ______________________________________________________________________

    Personal Motto: Why push the envelope when you can just open it?

    If you follow the direction given HERE[/url] you'll likely increase the number and quality of responses you get to your question.

    Jason L. Selburg

Viewing 8 posts - 1 through 7 (of 7 total)

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