This question is in regards to using the ReportingServices2005 WebService classes with C# .net 2.0. What I am having trouble with is how to relate a schedule to a subscription.
The piece of functionality that I am trying to duplicate is adding a report's subscription to a schedule (on the Subscription:{report_name} page's subscription processing options under the asp.net "Reports" app).
How can I programmatically set a report's subscription's "subscription processing options" to use one of my existing Schedules?
Some things I have tried:
- use ListSchedules to get a list of reports, use ListScheduledReport(scheduleId) to get a list of reports related to a schedule (this is great, it gets me the reports, but I can only add them via the asp.net Report app)
- use ListSubscriptions(Report.Path, null) to get a list of Subscriptions for a given report (this is great, too, but I do not see how to relate a subscription to a schedule).
The Reports app's database has a Schedule_Subscription_Report table, but I do not see any of the Web Services that can access it.
Please help!
Regards,
-Ben Waidhofer
Use CreateSubscription SOAP API and existing shared schedule.
If the schedule definition for a TimedSubscription is a shared schedule, you must pass the schedule ID of the shared schedule as the MatchData parameter. The schedule ID is passed as a String, for example, "4608ac1b-fc75-4149-9e15-5a8b5781b843". The schedule ID can be obtained by calling the ListSchedules method.
See http://msdn2.microsoft.com/en-us/library/microsoft.wssux.reportingserviceswebservice.rsmanagementservice2005.reportingservice2005.createsubscription.aspx
-Igor
|||Igor,
Much thanks, that does answer my question.
I read that if the schedule is ad-hoc, that is it is not a shared schedule that the MatchData parameter an xml-string representing a serialized ScheduleDefinition. Is that correct? If so, how does one serialize a ScheduleDefinition object to an xml-string?
Regards,
-Ben
|||Link from my previous reply contains a short version of XML for ScheduleDefinition. But generally you need to use XmlSerializer to convert ScheduleDefinition object into xml. This one looks like a good sample: http://www.odetocode.com/Articles/114.aspx
-Igor
No comments:
Post a Comment