Click here to monitor SSC
SQLServerCentral is supported by Red Gate Software Ltd.
 
Log in  ::  Register  ::  Not logged in
 
 
 
        
Home       Members    Calendar    Who's On


Add to briefcase

Data driven schedule with Reporting Services subscribed report Expand / Collapse
Author
Message
Posted Monday, October 22, 2007 6:08 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 6, 2008 7:33 AM
Points: 5, Visits: 19
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!
Post #413627
Posted Tuesday, October 23, 2007 6:15 AM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 5:23 PM
Points: 2,706, Visits: 3,782
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 you'll likely increase the number and quality of responses you get to your question.

Jason L. Selburg
Post #413840
Posted Tuesday, October 23, 2007 6:21 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: Banned Members
Last Login: Tuesday, July 22, 2014 3:58 AM
Points: 2,622, Visits: 327
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....
Post #413846
Posted Tuesday, October 23, 2007 7:21 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 10, 2010 5:07 AM
Points: 2,732, Visits: 23,078
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.
Post #413894
Posted Tuesday, October 23, 2007 8:55 AM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Friday, June 6, 2008 7:33 AM
Points: 5, Visits: 19
Thanks for the good advice! I think I'll go with Michael Earl's suggestion, since that would work nicely for my needs.
Post #413970
Posted Tuesday, October 23, 2007 9:08 AM
SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Tuesday, August 10, 2010 5:07 AM
Points: 2,732, Visits: 23,078
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.
Post #413980
Posted Tuesday, January 28, 2014 3:34 PM
Forum Newbie

Forum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum NewbieForum Newbie

Group: General Forum Members
Last Login: Wednesday, March 26, 2014 10:22 AM
Points: 1, Visits: 5
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?
Post #1535650
Posted Tuesday, January 28, 2014 4:06 PM


SSCrazy

SSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazySSCrazy

Group: General Forum Members
Last Login: Today @ 5:23 PM
Points: 2,706, Visits: 3,782
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 you'll likely increase the number and quality of responses you get to your question.

Jason L. Selburg
Post #1535654
« Prev Topic | Next Topic »

Add to briefcase

Permissions Expand / Collapse