Export (0) Print
Expand All
Expand Minimize
This topic has not yet been rated - Rate this topic

ReportingService2010::CreateSubscription Method

Creates a subscription for the specified item in the report server database or SharePoint library. This method applies to the Report item type.

Namespace:  ReportService2010
Assembly:  ReportService2010 (in ReportService2010.dll)
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
[SoapDocumentMethodAttribute(L"http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer/CreateSubscription", RequestNamespace = L"http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
	ResponseNamespace = L"http://schemas.microsoft.com/sqlserver/reporting/2010/03/01/ReportServer", 
	Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
[SoapHeaderAttribute(L"TrustedUserHeaderValue")]
public:
String^ CreateSubscription(
	String^ ItemPath, 
	ExtensionSettings^ ExtensionSettings, 
	String^ Description, 
	String^ EventType, 
	String^ MatchData, 
	array<ParameterValue^>^ Parameters
)

Parameters

ItemPath
Type: System::String
The fully qualified URL of the item including the file name and, in SharePoint mode, the extension.
ExtensionSettings
Type: ReportService2010::ExtensionSettings
An ExtensionSettings object that contains a list of settings that are specific to the delivery extension.
Description
Type: System::String
A meaningful description that is displayed to users.
EventType
Type: System::String
The type of event that triggers the subscription. The valid values are TimedSubscription or SnapshotUpdated.
MatchData
Type: System::String
The data that is associated with the specified EventType parameter. This parameter is used by an event to match the subscription with an event that has fired.
Parameters
Type: array<ReportService2010::ParameterValue>
An array of ParameterValue objects that contains a list of parameters for the item.

Return Value

Type: System::String
A subscription ID that uniquely identifies the subscription in the report server database or SharePoint library.

The table below shows header and permissions information on this operation.

SOAP Header Usage

(In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue

Native Mode Required Permissions

ExecuteAndView AND (CreateAnySubscription OR CreateSubscription)

SharePoint Mode Required Permissions

ViewListItems() AND (ManageAlerts() OR CreateAlerts())

You can use the GetExtensionSettings method to retrieve a list of required settings for a delivery extension. You must pass values for these required settings in the ExtensionSettings parameter. For information about e-mail delivery settings, see Reporting Services Delivery Extension Settings.

The value of the EventType parameter must correspond to an event that is configured for the report server. The two events that are used to create subscriptions are TimedSubscription and SnapshotUpdated. Use the ListEvents method to return a list of all events configured for the report server.

The value of the MatchData parameter depends on the event type. If the event is a TimedSubscription event, a ScheduleDefinition object is required as the MatchData parameter. You must first serialize the ScheduleDefinition object as XML in order to pass it as a string value and create a subscription based on the schedule. The XML structure might resemble the one in the following example:

<ScheduleDefinition>
   <WeeklyRecurrence>
      <StartDateTime>2004-06-24T09:00:00-08:00</StartDateTime>
      <WeeksInterval>1</WeeksInterval>
      <DaysOfWeek>
         <Monday>True</Monday>
         </DaysOfWeek>
   </WeeklyRecurrence>
</ScheduleDefinition>

The value of the StartDateTime element when it is passed as an XML string should correspond to the date format ISO 8601. This international date and time standard is the extended format CCYY-MM-DDThh:mm:ss+/-Z where "CC" represents the century, "YY" the year, "MM" the month and "DD" the day. The letter "T" is the date and time separator and "hh", "mm", "ss" represent hour, minute and second respectively. This representation can be immediately followed by a "Z" to indicate Coordinated Universal Time (UTC). To indicate the time zone, represented as the difference between the local time and Coordinated Universal Time, "Z" is preceded by a "+" or "-" sign, followed by the difference from UTC represented as hh:mm.

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.

You can use the XmlSerializer class to convert your object class to an XML string automatically.

If the event is a SnapshotUpdated subscription, the value of MatchData should be nullptr (or Nothing in Visual Basic).

When this method is used, it will set the LastExecutedSpecified property of the subscription to false, the Status property of the subscription to new subscription, and all properties of the subscription’s Active object to false. The ModifiedBy and ModifiedDate properties of the report are also updated.

Any schedule specified in the MatchData parameter must be in the same site and the ItemPath.

No code example is currently available or this language may not be supported.
Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.