ListSubscriptions 方法
傳回使用者為給定報表所建立的訂閱清單。此清單包括標準和資料導向訂閱。
命名空間: ReportService2005
組件: ReportService2005 (在 ReportService2005.dll 中)
語法
'宣告
<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListSubscriptions", RequestNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", _
ResponseNamespace := "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices", _
Use := SoapBindingUse.Literal, ParameterStyle := SoapParameterStyle.Wrapped)> _
<SoapHeaderAttribute("ServerInfoHeaderValue", Direction := SoapHeaderDirection.Out)> _
Public Function ListSubscriptions ( _
Report As String, _
Owner As String _
) As Subscription()
'用途
Dim instance As ReportingService2005
Dim Report As String
Dim Owner As String
Dim returnValue As Subscription()
returnValue = instance.ListSubscriptions(Report, _
Owner)
[SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListSubscriptions", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)]
[SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)]
public Subscription[] ListSubscriptions(
string Report,
string Owner
)
[SoapDocumentMethodAttribute(L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListSubscriptions", RequestNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
ResponseNamespace = L"https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
Use = SoapBindingUse::Literal, ParameterStyle = SoapParameterStyle::Wrapped)]
[SoapHeaderAttribute(L"ServerInfoHeaderValue", Direction = SoapHeaderDirection::Out)]
public:
array<Subscription^>^ ListSubscriptions(
String^ Report,
String^ Owner
)
[<SoapDocumentMethodAttribute("https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices/ListSubscriptions", RequestNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
ResponseNamespace = "https://schemas.microsoft.com/sqlserver/2005/06/30/reporting/reportingservices",
Use = SoapBindingUse.Literal, ParameterStyle = SoapParameterStyle.Wrapped)>]
[<SoapHeaderAttribute("ServerInfoHeaderValue", Direction = SoapHeaderDirection.Out)>]
member ListSubscriptions :
Report:string *
Owner:string -> Subscription[]
public function ListSubscriptions(
Report : String,
Owner : String
) : Subscription[]
傳回值
型別:array<ReportService2005. . :: . .Subscription> [] () [] []
Subscription 物件的陣列,表示特定報表的使用者訂閱。
備註
The table below shows header and permissions information on this operation.
SOAP Headers |
(Out) ServerInfoHeaderValue |
Required Permissions |
(ReadSubscription on the report AND the user is the subscription owner) OR ReadAnySubscription |
You can supply a null Nothing nullptr unit null 參考 (在 Visual Basic 中為 Nothing) (Nothing in Visual Basic) value for the Owner and Report parameters. The information that the ListSubscriptions method returns varies depending on the parameters that are submitted:
If the values of both Owner and Report are null Nothing nullptr unit null 參考 (在 Visual Basic 中為 Nothing) , the method returns all subscriptions for all reports that the current user has permission to view.
If only the Owner parameter is submitted, the method returns all subscriptions for all reports that the specified user has created and has permission to view.
If only the Report parameter is submitted, the method returns all subscriptions for all users of the specified report that the current user has permission to view.
If valid values are supplied for both the Owner parameter and Report parameter, the method returns all subscriptions for the specified report that the specified user created and has permission to view.
範例
To compile the following code example, you must reference the Reporting Services WSDL and import certain namespaces. For more information, see Compiling and Running Code Examples. The following example code uses the ListSubscriptions method to retrieve a list of subscriptions for the Employee Sales Summary report, which is owned by the user myDomain\myUserName:
Imports System
Imports System.Web.Services.Protocols
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2005()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
Dim extSettings As ExtensionSettings
Dim desc As String
Dim active As ActiveState
Dim status As String
Dim eventType As String
Dim matchData As String
Dim values As ParameterValue() = Nothing
Dim subscriptions As Subscription() = Nothing
Dim extensionParams As ParameterValueOrFieldReference() = Nothing
Try
subscriptions = rs.ListSubscriptions("/SampleReports/Employee Sales Summary", "myDomain\myUserName")
If Not (subscriptions Is Nothing) Then
' Retrieve properties for the first subscription in the list.
rs.GetSubscriptionProperties(subscriptions(0).SubscriptionID, extSettings, desc, active, status, eventType, matchData, values)
Console.WriteLine("Description: {0}", desc)
Console.WriteLine("Status: {0}", status)
Console.WriteLine("EventType: {0}", eventType)
Console.WriteLine("matchData: {0}", matchData)
Console.WriteLine("Extension: {0}", extSettings.Extension)
extensionParams = extSettings.ParameterValues
If Not (extensionParams Is Nothing) Then
Dim extensionParam As ParameterValueOrFieldReference
For Each extensionParam In extensionParams
Console.WriteLine((CType(extensionParam, ParameterValue).Name + ": " + CType(extensionParam, ParameterValue).Value))
Next extensionParam
End If
If Not (values Is Nothing) Then
Dim pv As ParameterValue
For Each pv In values
Console.WriteLine("Name: {0}", pv.Name)
Console.WriteLine("Value: {0}", pv.Value)
Next pv
End If
End If
Catch e As SoapException
Console.WriteLine(e.Detail.OuterXml)
End Try
End Sub 'Main
End Class 'Sample
using System;
using System.Web.Services.Protocols;
class Sample
{
public static void Main()
{
ReportingService2005 rs = new ReportingService2005();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
ExtensionSettings extSettings;
string desc;
ActiveState active;
string status;
string eventType;
string matchData;
ParameterValue[] values = null;
Subscription[] subscriptions = null;
ParameterValueOrFieldReference[] extensionParams = null;
try
{
subscriptions = rs.ListSubscriptions("/SampleReports/Employee Sales Summary",
@"myDomain\myUserName");
if ( subscriptions != null )
{
// Retrieve properties for the first subscription in the list.
rs.GetSubscriptionProperties(subscriptions[0].SubscriptionID, out extSettings, out desc, out active, out status, out eventType, out matchData, out values);
Console.WriteLine("Description: {0}", desc);
Console.WriteLine("Status: {0}", status);
Console.WriteLine("EventType: {0}", eventType);
Console.WriteLine("matchData: {0}", matchData);
Console.WriteLine("Extension: {0}", extSettings.Extension);
extensionParams = extSettings.ParameterValues;
if (extensionParams != null)
{
foreach (ParameterValueOrFieldReference extensionParam in extensionParams)
{
Console.WriteLine(((ParameterValue)extensionParam).Name + ": " + ((ParameterValue)extensionParam).Value);
}
}
if (values != null)
{
foreach (ParameterValue pv in values)
{
Console.WriteLine("Name: {0}", pv.Name);
Console.WriteLine("Value: {0}", pv.Value);
}
}
}
}
catch (SoapException e)
{
Console.WriteLine(e.Detail.OuterXml);
}
}
}