ReportingService2006.FireEvent(String, String, String) 方法

定义

基于提供的参数引发事件。

public:
 void FireEvent(System::String ^ EventType, System::String ^ EventData, System::String ^ Site);
public void FireEvent (string EventType, string EventData, string Site);
member this.FireEvent : string * string * string -> unit
Public Sub FireEvent (EventType As String, EventData As String, Site As String)

参数

EventType
String

事件的名称。

EventData
String

与事件关联的数据。

Site
String

SharePoint 站点的完全限定 URL。

示例

using System;  
using System.Collections.Generic;  
using System.IO;  
using System.Text;  
using System.Web;  
using System.Web.Services;  
using System.Web.Services.Protocols;  

class Sample  
{  
    static void Main(string[] args)  
    {  
        ReportingService2006 rs = new ReportingService2006();  
        rs.Url = "http://<Server Name>" +  
            "/_vti_bin/ReportServer/ReportService2006.asmx";  
        rs.Credentials =   
            System.Net.CredentialCache.DefaultCredentials;  

        string site = "http://<Server Name>";  

        // Get the subscriptions  
        Subscription[] subs =   
            rs.ListMySubscriptions(site);  

        try  
        {  
            if (subs != null)  
            {  
                // Fire the first subscription in the list  
                rs.FireEvent("TimedSubscription",   
                    subs[0].SubscriptionID, site);  
                Console.WriteLine("Event fired.");  
            }  
        }  
        catch (Exception ex)  
        {  
            Console.WriteLine(ex.Message);  
        }  
    }  
}  
Imports System  
Imports System.IO  
Imports System.Text  
Imports System.Web.Services  
Imports System.Web.Services.Protocols  

Class Sample  

    Public Shared Sub Main()  

        Dim rs As New ReportingService2006()  
        rs.Url = "http://<Server Name>" + _  
            "/_vti_bin/ReportServer/ReportService2006.asmx"  
        rs.Credentials = _  
            System.Net.CredentialCache.DefaultCredentials  

        Dim site As String = "http://<Server Name>"  

        ' Get the subscriptions  
        Dim subs As Subscription() = _  
            rs.ListAllSubscriptions(site)  

        Try  
            If Not (subs Is Nothing) Then  
                ' Fire the first subscription in the list  
                rs.FireEvent("TimedSubscription", subs(0).SubscriptionID, site)  
                Console.WriteLine("Event fired.")  
            End If  
        Catch ex As Exception  
            Console.WriteLine(ex.Message)  
        End Try  

    End Sub  

End Class  

注解

下表显示了有关此操作的标头和权限信息。

SOAP 标头 (In) TrustedUserHeaderValue

(Out) ServerInfoHeaderValue
所需的权限 <xref:Microsoft.SharePoint.SPBasePermissions.ManageWeb>

参数 EventType 与报表服务器配置文件 (rsreportserver.config) 中定义的已知事件集匹配。 如果事件不在报表服务器配置文件中,则会引发 SOAP 异常,错误代码 rsUnknownEventType为 。 方法 FireEvent 仅支持 TimedSubscription 事件类型。 指定 TimedSubscription 事件类型时,还必须在 中 EventData指定或 CreateSubscriptionCreateSubscription返回的订阅 ID。

方法 FireEvent 不验证或验证 参数中 EventData 提供的数据。 任何字符串值都有效,包括空字符串。

适用于