Interactions Between User , SSRS, and a Delivery ExtensionFigure 26.1 provides a partial class diagram for the printer delivery extension. Figure 26.1. Partial class diagram for the printer delivery extension.The user interacts with SSRS to create a subscription. The interaction could be done from a custom application using a SOAP API call to the SSRS web service's method CreateSubscription() . The interaction can also be performed through Report Manager, which performs the following:
Figure 26.2. An application's interaction with SSRS to create a subscription.Along with other parameters, CreateSubscription() accepts the full pathname of the report and the ExtensionSettings object, which, in turn , contain ParameterValue objects. ParameterValue objects contain name -value pairs with information that a delivery extension expects. For example, for email delivery, one of the parameter values is "TO:" information: extensionParams(0) = New ParameterValue() extensionParams(0).Name = "TO" extensionParams(0).Value = "administrator@adventure-works.com" SSRS then fills settings with information from ParameterValue and passes settings to a delivery extension for the validation ( ValidateUserData() call). After being validated , SSRS stores settings with the subscription and returns a SubscriptionID string to a user. When the time to "fire" a subscription comes, the SSRS scheduling engine sends a notification event to the Scheduling and Delivery Processor. See Figure 26.3 for the subscription delivery process. Figure 26.3. An application's interaction with SSRS to deliver a subscription to a printer.The Schedule and Delivery Processor receives a notification event, matches it to the subscription, creates a Notification object, and calls the Deliver method in a delivery extension, passing Notification as a parameter of the call. The delivery extension leverages SSRS's rendering extensions, using the Notification.Report.Render method. The Notification.Report.Render method returns the RenderOutputFile object. The RenderOutputFile.Data property contains a stream with a rendered report. The delivery extension then "decides" what to do with the stream. In the case of the printer delivery extension, the stream is converted to a metafile and printed using functionality from the System.Drawing.Printing namespace. |