Share via


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

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. 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 Headers (In) BatchHeaderValue

(Out) ServerInfoHeaderValue
Required Permissions GenerateEvents (System)

The EventType parameter is matched against the known set of events that are defined in the report server configuration file (rsreportserver.config). If the event is not in the report server configuration file, a SOAP exception is thrown with an error code of rsUnknownEventType. The FireEvent method only supports firing the TimedSubscription event type. When specifying the TimedSubscription event type, you must also specify the subscription ID in EventData, which is returned by CreateSubscription or CreateDataDrivenSubscription.

The FireEvent method does not verify or validate the data supplied in the EventData parameter. Any string value is valid, including an empty string.

Applies to