使用订阅(Web 门户)Working with subscriptions (web portal)

适用对象:APPLIES TO: SQL Server 2016 Reporting Services 及更高版本 Power BI 报表服务器 SQL Server 2016 Reporting Services 及更高版本 Power BI 报表服务器

使用“订阅”页可以列出当前报表的所有订阅。Use the Subscriptions page to list all of the subscriptions for the current report. 如果有足够的权限(指“管理所有订阅”任务),则可以查看所有用户的订阅。If you have sufficient permission (as conveyed by the "Manage all subscriptions" task), you can view the subscriptions of all users. 否则,此页仅显示您所拥有的订阅。Otherwise, this page shows only the subscriptions that you own.

必须确认报表数据源使用的是存储凭据,才能创建新订阅。Before you can create a new subscription, you must verify that the report data source uses stored credentials. 使用“数据源”属性页可以存储凭据。Use the Data Sources properties page to store credentials.

备注

需要启动 SQL Server 代理服务。The SQL Server Agent service needs to be started.

管理订阅Manage subscriptions
可通过依次选择报表的省略号 (…)、“管理”和“订阅”访问“订阅”页面 。You get to the Subscriptions page by selecting the ellipsis (...) of a report, selecting Manage and selecting Subscriptions.

从“订阅”页中,可以通过选择“+ 新订阅”来创建新订阅。From the Subscriptions page, you can create new subscriptions by selecting + New Subscription. 还可以编辑现有订阅,或删除选择的订阅。You can also edit existing subscriptions, or delete subscriptions that you have selected.

此页还在“结果”列中提供订阅运行的结果状态。This page also provides the result status of subscription runs on the Result column. 如果订阅出错,则需要首先检查结果列以查看消息内容。If an error occurred for a subscription, you will want to check the result column first to see what the message was.

还可随时通过选择“订阅”页上的“立即运行”来运行订阅。You can also run a subscription whenever you want by selecting Run now on the Subscriptions page.

创建或编辑订阅Creating or editing a subscription

使用“新建订阅”或“编辑订阅”页,可为报表创建新订阅或修改报表的现有订阅。Use the New Subscription or Edit Subscription page to create a new subscription or modify an existing subscription to a report. 此页包含的选项取决于您的角色分配。The options on this page vary depending on your role assignment. 具有高级权限的用户可以使用附加选项。Users with advanced permissions can work with additional options.

以无人参与的方式运行的报表支持订阅。Subscriptions are supported for reports that can run unattended. 报表必须最起码使用已存储的凭据或不使用凭据。At a minimum, the report must use stored or no credentials. 如果报表使用参数,则必须指定默认值。If the report uses parameters, a default value must be specified. 如果更改报表执行设置或删除参数属性使用的默认值,订阅可能进入非活动状态。Subscriptions may become inactive if you change report execution settings or remove the default values used by parameter properties. 有关详细信息,请参阅创建和管理本机模式报表服务器的订阅For more information, see Create and Manage Subscriptions for Native Mode Report Servers .

订阅的类型Type of subscription

可以在“标准订阅”与“数据驱动订阅”之间进行选择 。You can select between a Standard subscription and a Data-driven subscription.

显示“订阅类型”部分的屏幕截图。

数据驱动订阅是在每次运行订阅时,都会在订阅服务器数据库中查询订阅信息的订阅。A data-driven subscription is one that queries a subscriber database for subscription information each time the subscription runs. 数据驱动订阅使用查询结果来确定订阅的收件人、传递设置和报表参数值。Data-driven subscriptions use query results to determine the recipients of the subscription, delivery settings, and report parameter values. 在运行时,报表服务器将运行一个查询,以获取订阅设置所需的值。At run time, the report server runs a query to get values used for subscription settings.

要创建数据驱动订阅,您必须了解如何编写查询或命令来获取订阅的数据。To create a data-driven subscription, you must know how to write a query or command that gets the data for the subscription. 还必须有一个数据存储,其中包含要用于订阅的订阅服务器数据(例如订阅服务器名称和电子邮件地址)。You must also have a data store that contains the subscriber data (for example, subscriber names and email addresses) to use for the subscription.

具有高级权限的用户可以使用此选项。This option is available to users with advanced permissions. 如果使用的是默认的安全设置,则位于“我的报表”文件夹的报表将无法使用数据驱动订阅。If you are using default security, data-driven subscriptions cannot be used for reports located in a My Reports folder.

目标Destination

选择用于分发报表的传递扩展插件。Select the delivery extension to use to distribute the report.

传递扩展插件的可用性取决于其是否在报表服务器上进行了安装和配置。The availability of a delivery extension depends on whether it is installed and configured on the report server. 报表服务器电子邮件是默认的传递扩展插件,但是使用前必须先行配置。Report Server email is the default delivery extension, but it must be configured before you can use it. 文件共享传递不需要配置,但是使用前必须定义一个共享文件夹。File Share delivery does not require configuration, but you must define a shared folder before you can use it.

显示目标和传递选项(Windows 文件共享)部分的屏幕截图。

根据选定的传递扩展插件,会显示下列设置:Depending on the delivery extension you select, the following settings appear:

  • 电子邮件订阅提供了电子邮件用户所熟悉的字段(例如“收件人”、“主题”和“优先级”字段)。Email subscriptions provide fields that are familiar to email users (for example, To, Subject, and Priority fields). 指定 “包括报表” 可以嵌入或附加报表,而指定 “包括链接” 可以将 URL 包括在报表中。Specify Include Report to embed or attach the report, or Include Link to include a URL to the report. 指定 “呈现格式” 可以选择附加报表或嵌入报表的显示格式。Specify Render Format to choose a presentation format for the attached or embedded report. 有关详细信息,请参阅创建电子邮件订阅See Create an email subscription for details.

  • 文件共享订阅提供了允许您指定目标位置的字段。File share subscriptions provide fields that allow you to specify a target location. 您可以将任何报表传递到文件共享位置。You can deliver any report to a file share. 但是,支持交互式功能的报表(包括支持深化以及支持行和列的矩阵报表)将以静态文件的形式呈现。However, reports that support interactive features (including matrix reports that support drill-down to supporting rows and columns) are rendered as static files. 无法查看静态文件中的深化行和深化列。You cannot view drill-down rows and columns in a static file. 必须以通用命名约定 (UNC) 格式指定文件共享名(例如,\mycomputer\public\myreportfiles)。The file share name must be specified in Uniform Naming Convention (UNC) format (for example, \mycomputer\public\myreportfiles). 不能在路径名的末尾包含反斜杠。Do not include a trailing backslash in the path name. 报表文件将以基于呈现格式的文件格式进行传递(例如,如果选择 Excel,则报表以 .xlsx 文件格式进行传递)。The report file will be delivered in a file format that is based on the render format (for example, if you choose Excel, the report is delivered as an .xlsx file). 有关详细信息,请参阅创建文件共享订阅See Create a file share subscription for details.

数据驱动订阅数据集Data-driven subscription dataset

对于数据驱动订阅,需要定义用于订阅的数据集。For a data-driven subscription, you will need to define the dataset used for the subscription. 选择“编辑数据集”以提供该信息。Select Edit Dataset to supply that information.

显示数据集部分的屏幕截图。

需要首先提供要用于查询的 数据源You need to first provide a data source to use for the query. 这可以是共享数据源,也可以提供自定义数据源。This can be either a shared data source, or you can supply a custom data source.

随后需要提供列出运行订阅所需的不同选项的 查询You will need to then supply a query that will list the different options needed for the subscription to run. 屏幕会提供需要返回的字段。The screen will provide the fields that need to be returned. 这些字段因传递方法和报表参数而异。These fields will vary depending on your delivery method and the parameters of the report.

为了实现最佳效果,在数据驱动的订阅中使用该查询之前,请先在 SQL Server Management Studio 中运行该查询。For best result, run the query in SQL Server Management Studio first, before using it in the data-driven subscription. 之后可以检查查询结果,验证它是否包含所需的信息。You can then examine the results to verify that it contains the information you require. 对于查询结果,请注意下面的几个要点:Important points to recognize about the query results are:

  • 结果集内的列确定可以为传递选项和报表参数指定的值。Columns in the result set determine the values that you can specify for delivery options and report parameters. 例如,如果要为电子邮件传递创建数据驱动订阅,则应具有一列电子邮件地址。For example, if you are creating a data-driven subscription for email delivery, you should have a column of email addresses.

  • 结果集内的行决定了所生成的报表传递的数量。Rows in the result set determine the number of report deliveries that are generated. 如果您有 10,000 行,则报表服务器将生成 10,000 个通知和传递。If you have 10,000 rows, the report server will generate 10,000 notifications and deliveries.

显示查询部分的屏幕截图。

随后可以验证查询。You can then validate the query. 还可以定义 查询超时You can also define a query timeout.

创建了查询之后,随后可以将值分配给必填字段。After the query has been created, you can then assign values to the required fields. 可以输入手动数据,也可以从创建的数据集选择字段。You can either enter your manual data, or select a field from the dataset you created.

后续步骤Next steps

创建和管理本机模式报表服务器的订阅 Web 门户Create and Manage Subscriptions for Native Mode Report Servers Web portal
使用分页报表Working with paginated reports
使用共享数据集Work with Shared Datasets

更多疑问?More questions? 请访问 Reporting Services 论坛Try asking the Reporting Services forum