ReportingService2005.FireEvent(String, String) Method
Definition
基于提供的参数触发事件。Triggers an event based on the supplied parameters.
public:
void FireEvent(System::String ^ EventType, System::String ^ EventData);
public void FireEvent (string EventType, string EventData);
member this.FireEvent : string * string -> unit
Public Sub FireEvent (EventType As String, EventData As String)
Parameters
- EventType
- String
事件的名称。The name of the event.
- EventData
- String
与事件关联的数据。The data that is associated with the event.
Examples
若要编译此代码示例,必须引用 Reporting Services WSDL 并导入某些命名空间。To compile this code example, you must reference the Reporting Services WSDL and import certain namespaces. 有关详细信息,请参阅 编译和运行代码示例。For more information, see Compiling and Running Code Examples. 下面的代码示例在 Report Server 数据库中搜索名称中包含 "Sales" 一词的所有报告:The following code example searches the report server database for all reports whose names contain the word "Sales":
Imports System
Class Sample
Public Shared Sub Main()
Dim rs As New ReportingService2005()
rs.Credentials = System.Net.CredentialCache.DefaultCredentials
' Get the subscriptions
Dim subs As Subscription() = rs.ListSubscriptions("/SampleReports/Company Sales", Nothing)
Try
If Not (subs Is Nothing) Then
' Fire the first subscription in the list
rs.FireEvent("TimedSubscription", subs(0).SubscriptionID)
Console.WriteLine("Event fired.")
End If
Catch ex As Exception
Console.WriteLine(ex.Message)
End Try
End Sub 'Main
End Class 'Sample
using System;
class Sample
{
public static void Main()
{
ReportingService2005 rs = new ReportingService2005();
rs.Credentials = System.Net.CredentialCache.DefaultCredentials;
// Get the subscriptions
Subscription[] subs = rs.ListSubscriptions("/SampleReports/Company Sales", null);
try
{
if (subs != null)
{
// Fire the first subscription in the list
rs.FireEvent("TimedSubscription", subs[0].SubscriptionID);
Console.WriteLine("Event fired.");
}
}
catch (Exception ex)
{
Console.WriteLine(ex.Message);
}
}
}
Remarks
下表显示了有关此操作的标头和权限信息。The table below shows header and permissions information on this operation.
SOAP 标头SOAP Headers | (In) BatchHeaderValue(In) BatchHeaderValue (Out) ServerInfoHeaderValue(Out) ServerInfoHeaderValue |
所需的权限Required Permissions | GenerateEvents (系统) GenerateEvents (System) |
EventType
参数与 ( # A0) Report Server 配置文件中定义的已知事件集相匹配。The EventType
parameter is matched against the known set of events that are defined in the report server configuration file (rsreportserver.config). 如果 Report Server 配置文件中不存在该事件,则会引发一个错误代码为的 SOAP 异常 rsUnknownEventType
。If the event is not in the report server configuration file, a SOAP exception is thrown with an error code of rsUnknownEventType
. FireEvent方法只支持激发 TimedSubscription
事件类型。The FireEvent method only supports firing the TimedSubscription
event type. 指定 TimedSubscription 事件类型时,还必须在中指定订阅 ID EventData
,该 ID 由 CreateSubscription 或返回 CreateDataDrivenSubscription 。When specifying the TimedSubscription event type, you must also specify the subscription ID in EventData
, which is returned by CreateSubscription or CreateDataDrivenSubscription.
FireEvent方法不验证或验证参数中提供的数据 EventData
。The FireEvent method does not verify or validate the data supplied in the EventData
parameter. 任何字符串值都有效,包括空字符串。Any string value is valid, including an empty string.