Run report based on a value in database.
In SSRS 2008:
I want a report to run (and send by mail) based on a value in a table.
Eg. if a value in a table has a certain value, a report should be run (and send by mail)
I could not find something like this in the settings for schedules or subscriptions.
Anyone knows how to do this?
November 23rd, 2010 4:49pm
Please Have a look, following might help you
http://www.mssqltips.com/tip.asp?tip=2106Gaurav Gupta http://sqlservermsbiblog.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2010 4:57pm
Thanks for the reply Gaurav.
I don't see a solution on the site you gave me.
What I want is something like this:
I have a table with "incident" records with a status field and if there are more then 10 records with status "unsolved", the
reportserver has to send a report with those records to an email adres.
So.. the data (instead of a schedule) must be the trigger to run and send the report.
November 23rd, 2010 5:46pm
ohhh, sorry ,
I don't see any way that we can do it,
let see if any one give us any clue...Gaurav Gupta http://sqlservermsbiblog.blogspot.com/
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2010 5:52pm
You need to create a subscription with a schedule to be executed once, for example in the past. Add email addresses as needed.
Find a job on the SQL Server agent corresponding to your report subscription schedule (in our case it is a subscription executed in the past). Use reportserver database to find the name of the subscription. A job name corresponding SSRS subscription looks
like D543C20C-6A8A-435E-A687-16EA66B4D4A2 Create a new job "RunSSRSSubscription" on SQL Server agent. Add t-sql in the job step
IF DB_value > 0
sp_start_job [D543C20C-6A8A-435E-A687-16EA66B4D4A2] ... Schedule this job ("RunSSRSSubscription") to run every 5 nimutes (whatever interval)
You are done
Sergei
November 23rd, 2010 6:02pm
Yes! That's what I was looking for.
Thanks Sergei!
Free Windows Admin Tool Kit Click here and download it now
November 23rd, 2010 6:08pm
That was tricky....
Nice one Sergei....Gaurav Gupta http://sqlservermsbiblog.blogspot.com/
November 23rd, 2010 7:38pm