Subscriptions – data-driven subscription

Another type of subscription is the data-driven subscription. This is a powerful way of creating subscriptions since you can use the database to set most of the properties of the subscription. The data-driven subscription is generated through a wizard. There are three different methods of delivery: e-mail, file share, and null. The null delivery does not generate a report. It is used to preload the cache for a report that is set up for using cached data.

Let's create a subscription to be sent out on the first of each month for each of the sales people:

Step 1 – specify the type of data-driven subscription

  1. Select the toolbar item called New Data-driven Subscription.
  2. Set the Description property to Last Month's Commissions for Each Sales Person.
  3. Set the Specify how recipients are notified property to E-mail.
  4. Select the Specify a shared data source option button.
  5. Click on the Next button.

Step 2 – select the location of the shared data source

  1. Set the Location property to /Data Source/DS_SSRS2012Blueprints.
  2. Click on the Next button.

Step 3 – set up the SQL statement or stored procedure that will return the data-driven property data.

  1. Set the query to the following code: exec dbo.uspSalesCommissionsSubscription.
  2. Click on the Validate button to verify if the query works.
  3. Click on the Next button.

Note

This page has some handy information. It tells you exactly what fields you can have the query return for the data-driven subscription.

Step 3 – set up the SQL statement or stored procedure that will return the data-driven property data.

Step 4 – set up the delivery properties

  1. Select the Get the value from the database option button for the To property.
  2. Select EmailAddress from the drop-down list.
  3. Select PDF from the drop-down list for the Render Format property.
  4. Select the Get the value from the database option button for the Comment property.
  5. Select EmailMessage from the drop-down list.
  6. Click on the Next button:
    Step 4 – set up the delivery properties

Step 5 – set up the parameter values

  1. Select the Get the value from the database option button for the Requested Date property.
  2. Select RequestedDate from the drop-down list.
  3. Select the Get the value from the database option button for the SalesPersonID property.
  4. Select SalesPersonID from the drop-down list.
  5. Click on the Next button.

Step 6 – set up the schedule for the subscription

  1. Select the On a shared schedule option.
  2. Select First of the Month as 2 am from the drop-down list.
  3. Click on the Finish button.
    Step 6 – set up the schedule for the subscription

Note

Subscriptions should be tested just like reports to make sure the parameters work correctly, and that the e-mail settings were accurately created. One way to test is to have the report sent to you a few minutes into the future. This will allow you to test the subscription without having to wait days or even months.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.145.87.161