Asked by:
Create Data Driven Subscription via C# code? SSRS 2005 EE (or Batch Reports?)

Question
-
User1316350542 posted
Hello,Does anyone know if you can create a Data Driven Subscription via code (C#)? The web based Report Manager does it via the Subscriptions.aspx (I assume). Seems like they are using the Microsoft.ReportingServices.UI.Pages.Subscriptions namespace.I can't find any info on anybody doing it. So, here's my need, please tell me if I am on the right track.In my ASP.NET 2.0 C# app, we use the SSRS Web Service (reportservice2005) to generate PDF reports in a new window. If the User requests a large amount of pages (say 1000), the request is timing out, as well as tying up the web server.So, the thought was, why not submit these reports to a "Batch". It seems that Data Driven Subscriptions could do it but what I'd want is to create the Subscription on the fly and clean them up after they run (or weekly).Should I go this approach, OR should I write a Windows Service (or Console App) that just uses the same SSRS Web Service (reportservice2005) to create my reports in batch mode?Any thoughts are helpful.Tuesday, November 6, 2007 4:42 AM
All replies
-
User1316350542 posted
Nothing like answering your own question. I guess after a good night's sleep I Googled the right phrase to see this link:There is a CreateDataDrivenSubscription() method.However, given my original question on proper approach, should I be doing it this way or write the windows service or console app to do it?Thoughts?Tuesday, November 6, 2007 3:21 PM -
User-437294230 posted
Hi,
Using this Method i can create jobs in sqlserver agent and it also displaying in reportmanager. but while it is executing it is showing status message as done the process total 1 with 1 errors.
do i need to do any configurations?
please help me.
Thanks in Advance....
Tuesday, March 11, 2008 1:22 AM -
User1316350542 posted
If you are getting errors, check the log files. On my server, they are at C:\Program Files\Microsoft SQL Server\MSSQL.2\Reporting Services\LogFiles
I also found out that I didn't need to use Data Driven Subscriptions, but standard Subscriptions worked for me too and does not require Enterprise Edition on the server.
If you are outputting to a FileShare, make sure that the UID & Pwd that you specifiy on the subscription also has rights to the share point. (i.e. \\server\sharename).
The log files are a mess, but it will tell you what's wrong. Out of all my errors, there were usually either:
1. Permissions to share folder and/or SQL
2. Out of memory errors trying to generate a large PDF.Good luck.
Mike =:-)
Tuesday, March 11, 2008 1:40 AM -
User-437294230 posted
Failure sending mail: The pickup directory path is required and was not specified.
am getting this error...i didnt understand whts pickup directory path..could u please help me
Tuesday, March 11, 2008 2:29 AM -
User1316350542 posted
Oh, sorry, I wish I could help but I have not done that yet. I have heard that the emailing can be problematic, so I went with FleShare.
This is a good site for info on SSRS with links to MSDN Home Page for SSRS too:
http://blogs.msdn.com/lukaszp/archive/2007/05/25/new-reporting-services-portal-on-msdn.aspxCheck it out.
Tuesday, March 11, 2008 4:00 AM -
User-437294230 posted
Thanks alot Mike
Tuesday, March 11, 2008 5:09 AM -
User-1067163466 posted
Check out these articles:
http://www.sqlservercurry.com/2009/07/programmatically-create-data-driven.html
http://www.codeproject.com/Articles/36009/Programmatically-Playing-With-SSRS-Subscriptions
The last link is MSDN so if you look on the left you will see all the class properties and methods for this Web Service.
Wednesday, July 25, 2012 9:33 PM