MSDN

Microsoft Docs

Subscriptions in SQL Server Reporting Services

Subscriptions automate the delivery of reports on a scheduled basis. SSRS supports two main types of subscriptions: Email and File Share. This page explains how to create, manage, and programmatically control subscriptions.

Email Subscriptions
File Share Subscriptions
API & PowerShell

Creating an Email Subscription

  1. Open Report Manager (or the web portal) and navigate to the desired report.
  2. Select Subscribe > New Subscription.
  3. Configure the following options:
    • To: List of email addresses (semicolon separated).
    • Subject: Use placeholders like @ReportName.
    • Render format: PDF, Excel, Word, etc.
    • Schedule: Define recurrence (daily, weekly, monthly).
  4. Click Apply to save the subscription.

Sample Email Subscription XML (RDL)

<Subscription>
  <Description>Daily Sales Report</Description>
  <EventType>TimedSubscription</EventType>
  <MatchData>
    <ScheduleDefinition>
      <WeeklyRecurrence>
        <DaysOfWeek>Monday,Tuesday,Wednesday,Thursday,Friday</DaysOfWeek>
        <WeeksInterval>1</WeeksInterval>
      </WeeklyRecurrence>
      <StartDateTime>2025-01-01T07:00:00Z</StartDateTime>
    </ScheduleDefinition>
  </MatchData>
  <DeliverySettings>
    <ExtensionSettings>
      <Extension>Report Server Email</Extension>
      <ParameterValues>
        <ParameterValue>
          <Name>TO</Name>
          <Value>sales@example.com</Value>
        </ParameterValue>
        <ParameterValue>
          <Name>Subject</Name>
          <Value>Daily Sales Report - @ReportName</Value>
        </ParameterValue>
      </ParameterValues>
    </ExtensionSettings>
  </DeliverySettings>
</Subscription>

Creating a File Share Subscription

  1. In Report Manager, go to the target report and choose Subscribe > New Subscription.
  2. Select File Share as the delivery method.
  3. Specify:
    • Path: UNC path (e.g., \\fileserver\Reports\Daily\sales.pdf).
    • Username/Password: If the Report Server needs credentials to access the share.
    • Render format: PDF, Excel, etc.
    • Schedule: Define when the file should be generated.
  4. Click Apply to save.

PowerShell Example: Creating a File Share Subscription

Import-Module ReportingServicesTools

$ReportPath = "/Sales/MonthlyReport"
$Subscription = New-RsSubscription `
    -ReportServerUri "http://myrsserver/reportserver" `
    -Path $ReportPath `
    -DeliveryExtension "Report Server FileShare" `
    -Parameter @{ } `
    -Schedule (New-RsSchedule -Weekly -DaysOfWeek Monday -StartTime "06:00 AM") `
    -FileSharePath "\\fileserver\reports\monthly.pdf" `
    -FileShareUserName "domain\rs_user" `
    -FileSharePassword (Read-Host -AsSecureString "Password")
Write-Host "Subscription ID:" $Subscription.SubscriptionId

Programmatic Management of Subscriptions

SSRS exposes a SOAP API (ReportService2010) and a REST API (/api/v2.0) for subscription operations.

REST Example: List Subscriptions for a Report

GET https://myrsserver/reportserver/api/v2.0/reports/Reports%2FSales%2FMonthlyReport/subscriptions
Authorization: Bearer <access-token>

Creating a Subscription via REST

POST https://myrsserver/reportserver/api/v2.0/reports/Reports%2FSales%2FMonthlyReport/subscriptions
Headers:
  Content-Type: application/json
  Authorization: Bearer <access-token>

Body:
{
  "delivery": {
    "extension": "Report Server Email",
    "settings": {
      "TO": "user@example.com",
      "Subject": "Monthly Sales Report"
    }
  },
  "schedule": {
    "recurrence": "Monthly",
    "daysOfMonth": [1],
    "time": "08:00"
  },
  "renderFormat": "PDF"
}

C# Sample: Using ReportService2010

using System;
using ReportService2010;

class Program {
    static void Main() {
        var rs = new ReportingService2010SoapClient();
        rs.ClientCredentials.Windows.AllowedImpersonationLevel = System.Security.Principal.TokenImpersonationLevel.Impersonation;

        var sub = new Subscription {
            Owner = "DOMAIN\\user",
            Description = "Weekly Report",
            EventType = "TimedSubscription",
            DeliverySettings = new ExtensionSettings {
                Extension = "Report Server Email",
                ParameterValues = new ParameterValue[] {
                    new ParameterValue { Name = "TO", Value = "user@example.com"},
                    new ParameterValue { Name = "Subject", Value = "Weekly Report"}
                }
            },
            MatchData = "..."
        };

        string id = rs.CreateSubscription(sub, "/Sales/WeeklyReport", null);
        Console.WriteLine($"Created subscription ID: {id}");
    }
}