管理共用資料集Manage Shared Datasets

Reporting ServicesReporting Services中,共用資料集是從連接至外部資料來源的共用資料來源擷取資料。In Reporting ServicesReporting Services, shared datasets retrieve data from shared data sources that connect to external data sources. 共用資料集提供方法以共用查詢,可協助您為多個報表提供一致的資料集。A shared dataset provides a way to share a query to help provide a consistent set of data for multiple reports. 資料集查詢可以包含資料集參數。The dataset query can include dataset parameters. 您可以在第一次使用時或指定排程,設定共用資料集以快取特定參數組合的查詢結果。You can configure a shared dataset to cache query results for specific parameter combinations on first use or by specifying a schedule. 您可以使用共用資料集快取,配合報表快取及報表資料摘要,協助管理資料來源的存取。You can use shared dataset caching in combination with report caching and report data feeds to help manage access to a data source.

共用資料集只使用共用資料來源,而不使用內嵌資料來源。Shared datasets use only shared data sources, not embedded data sources. 共用資料集可以根據已支援 Reporting ServicesReporting Services 資料延伸模組或報表模型的任何資料來源。A shared dataset can be based on any data source for a supported Reporting ServicesReporting Services data extension or on a report model.

建立及使用共用資料集Creating and Using Shared Datasets

若要建立共用資料集,您必須使用可建立共用資料集定義檔 (.rsd) 的應用程式。To create a shared dataset, you must use an application that creates a shared dataset definition file (.rsd). 您可以使用下列其中一個應用程式來建立共用資料集:You can use one of the following applications to create a shared dataset:

  • 報表產生器:使用共用資料集設計模式,並將共用資料集儲存至報表伺服器或 SharePoint 網站。Report Builder Use shared dataset design mode and save the shared dataset to a report server or SharePoint site.

  • SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) 中的報表設計師:在 [方案總管] 中的 [共用資料集] 資料夾下建立共用資料集。Report Designer in SQL Server Data Tools (SSDT)SQL Server Data Tools (SSDT) Create shared datasets under the Shared Dataset folder in Solution Explorer. 若要發行共用資料集,則將資料集部署到報表伺服器或 SharePoint 網站。To publish a shared dataset, deploy it to a report server or SharePoint site.

  • 上傳共用資料集定義 (.rsd) 檔案:您可以將檔案上傳至報表伺服器或 SharePoint 網站。Upload a shared dataset definition (.rsd) file You can upload a file to the report server or SharePoint site. 在 SharePoint 網站上,On a SharePoint site. 共用資料集進行快取或在報表中使用之前,上傳的檔案不會依結構描述進行驗證。An uploaded file is not validated against the schema until the shared dataset is cached or used in a report.

    共用資料集定義包括:查詢、含預設值的資料集參數、資料選項 (例如,大小寫區分和資料集篩選)。The shared dataset definition includes a query, dataset parameters including default values, data options such as case sensitivity, and dataset filters. 只要報表中包含共用資料集,就會使用您在定義中設定的值。Values that you set in the definition are used whenever the shared dataset is included in a report.

    若要在報表中使用共用資料集,您可以開啟應用程式 (如報表產生器),瀏覽至報表伺服器或 SharePoint 網站,然後選取共用資料集。To use a shared dataset in a report, you open an application such as Report Builder, browse to the report server or SharePoint site, and select the shared dataset. 這會將共用資料集的執行個體加入報表。This adds an instance of the shared dataset to the report. 您無法在報表中檢視或者變更查詢或共用資料集的共用資料來源。In the report, you cannot view or change the query or the shared data source for the shared dataset. 您可以指定套用至報表中執行個體的其他資料集屬性值集。You can specify an additional set of dataset property values that apply to the instance in the report. 例如,您可以加入篩選器,或變更區分大小寫等資料選項。For example, you can add a filter or change data options such as case sensitivity. 如需詳細資訊,請參閱 msdn.microsoft.com 上報表產生器文件中的報表內嵌資料集和共用資料集 (報表產生器及 SSRS)For more information, see Report Embedded Datasets and Shared Datasets (Report Builder and SSRS) in the Report Builder documentation on msdn.microsoft.com.

管理共用資料集Managing Shared Datasets

若要管理已發行共用資料集的屬性,您可以針對原生模式報表伺服器使用報表管理員,或是如果將報表伺服器部署為 SharePoint 整合模式,則使用 SharePoint 網站上的應用程式頁面。To manage the properties of a published shared dataset, you can use Report Manager for a native mode report server, or application pages on a SharePoint site if you deployed the report server in SharePoint integrated mode. 您可以在共用資料集上執行的工作取決於您的角色指派及站台層級和項目層級使用權限,如果實際上權限是繼承而來的,則也包括資料夾權限。The tasks that you can perform on a shared dataset depend on your role assignments and on site level and item level permissions, including permissions on the folder if permission inheritance is in effect. 共用資料集的項目層級安全性遵循與報表相同的項目層級安全性模型。Item level security for shared datasets follow the same model as item level security for reports. 如需詳細資訊,請參閱 保護共用資料集項目的安全For more information, see Secure Shared Dataset Items.

您可以與使用共用資料集的報表或其相依的共用資料來源分開,獨立管理共用資料集項目屬性 (包括所要使用的共用資料來源)。You can manage the shared dataset item properties, including the shared data source to use, independently from the report that uses the shared dataset or the shared data source that it depends on. 若要變更查詢或屬於共用資料集定義一部分的其他資料集屬性,您必須編輯定義。To change the query or other dataset properties that are part of the shared dataset definition, you must edit the definition.

管理共用資料集項目屬性Manage Shared Dataset Item Properties

下表列出您可以為共用資料集項目變更的項目屬性。The following table lists the item properties that you can change for a shared dataset item.

編輯名稱Edit Name 變更共用資料集的名稱。Change the name of the shared dataset. 相依項目的所有參考都將繼續運作。All references from dependent items will continue to work.
編輯描述Edit Description 變更共用資料集的描述。Change the description of the shared dataset.
編輯查詢執行逾時Edit Query execution time out 設定查詢執行逾時,以秒為單位。Set the query execution timeout in seconds. 零 (0) 秒表示無逾時。決定資料集查詢逾時之前的秒數。若要指定無逾時值,請使用 0。Zero (0) seconds means no time out. Determines the number of seconds before the dataset query times out. To specify no timeout value, use 0. 如需詳細資訊,請參閱設定報表和共用資料集處理的逾時值 (SSRS)For more information, see Setting Time-out Values for Report and Shared Dataset Processing (SSRS).
檢視相依項目View dependent items 檢視使用此共用資料集的項目:已發行的報表組件、共用資料來源和報表。View the items that use this shared dataset: published report parts, shared data sources, and reports.

下列的其他共用資料集屬性會自動進行設定:The following additional shared dataset properties are automatically configured:

屬性Property 描述Description
HasDataSourceCredentialsHasDataSourceCredentials 關聯的共用資料來源是否有認證儲存在報表伺服器上。Whether the associated shared data source has credentials saved on the report server.
HasUserProfileDependenciesHasUserProfileDependencies 報表在其查詢或篩選運算式中是否具有使用者全域集合參考。Whether the report has a reference to the User global collection in its query or in filter expressions.

檢視或變更共用資料集定義Viewing or Changing the Shared Dataset Definition

共用資料集屬性 (包括查詢、資料集參數、預設值、資料集篩選,以及定序和大小寫區分等資料選項) 是儲存於共用資料集定義中。Shared dataset properties, including the query, dataset parameters, default values, dataset filters, and data options such as collation and case sensitivity, are saved in the shared dataset definition. 如果您具有足夠的權限,便可檢視與變更定義。If you have sufficient permissions, you can view and change the definition.

若要檢視或變更共用資料集定義,請在共用資料集設計模型中的報表產生器之類應用程式中,編輯共用資料集。To view or change the shared dataset definition, edit the shared dataset in an application such as Report Builder in shared dataset design mode. 變更之後,將共用資料集定義回存至伺服器或網站。After you make changes, save the shared dataset definition back to the server or site.

在 XML 中檢視共用資料集定義的另一個方法是:在報表管理員中使用 URL 存取語法。Another way to view the shared dataset definition in XML is to use URL access syntax in Report Manager. 例如,若要檢視每個資料集參數的預設值,您可以使用下列 URL 存取命令,從報表伺服器顯示名為 DataSet1 的共用資料集定義:For example, to view the default values for each dataset parameter, you can use the following URL access command to display a shared dataset definition named DataSet1 from the report server:


控制共用的資料集定義的存取Controlling Access to the Shared Dataset Definition

根據預設,下列工作適用於共用資料集上的作業。By default, the following tasks apply to operations on shared datasets.

  • 檢視報表 :檢視共用資料集項目和項目屬性。View Reports View shared dataset items and item properties.

  • 取用報表 :讀取共用資料集定義。Consume Reports Read shared dataset definitions.

  • 管理報表 :建立及刪除共用資料集,並編輯共用資料集屬性。Manage Reports Create and delete shared datasets and edit shared dataset properties.

  • 在項目上設定安全性 :檢視及修改共用資料集的安全性設定。Set security on Items View and modify security settings for shared datasets.

    如需控制存取原生模式報表伺服器之資料來源屬性的工作和權限的詳細資訊,請參閱 保護共用資料集項目的安全For more information about which tasks and permissions control access to data source properties on a native mode report server, see Secure Shared Dataset Items.

    檢視及編輯 SharePoint 文件庫內項目屬性的權限是由網站管理員所決定。Permissions to view and edit properties for items in a SharePoint library are determined by the site administrator. 如需詳細資訊,請參閱 報表伺服器項目的 SharePoint 網站和清單權限參考For more information, see SharePoint Site and List Permission Reference for Report Server Items.

如何在報表伺服器上處理共用資料集屬性How to Work with Shared Dataset Properties on a Report Server

您可以使用各種不同工具來處理共用資料集。You can use a variety of tools to work with shared datasets. 下表摘要列出方法和工具,並提供其他指示的連結。The following table summarizes the approaches and tools, and provides a link to additional instructions.

工作Task 工具Tool 連結Link
新增共用資料集,或變更共用資料集定義屬性。Add a shared dataset or change shared dataset definition properties. 儲存在報表產生器中。Save in Report Builder.

部署在報表設計師中。Deploy in Report Designer.

上傳報表管理員中的 .rsd 檔案Upload an .rsd file in Report Manager
msdn.microsoft.com 之報表產生器文件中的報表內嵌資料集和共用資料集 (報表產生器及 SSRS)Report Embedded Datasets and Shared Datasets (Report Builder and SSRS) in the Report Builder documentation on msdn.microsoft.com

上傳檔案頁面 (報表管理員)Upload File Page (Report Manager)

如果在相依的共用資料來源發行之前上傳共用資料集,必須以手動方式將共用資料集繫結至共用資料來源。If you upload a shared dataset before the shared data source that it depends is published, you must manually bind the shared dataset to the shared data source. 如需詳細資訊,請參閱 msdn.microsoft.com 之 一般屬性頁面、共用資料集 (報表管理員)For more information, see General Properties Page, Shared Datasets (Report Manager).
變更共用資料集項目屬性。Change shared dataset item properties. 報表管理員Report Manager 一般屬性頁面、共用資料集 (報表管理員)General Properties Page, Shared Datasets (Report Manager)
為報表中的共用資料集執行個體指定其他共用資料集屬性。Specify additional shared dataset properties for a shared dataset instance in a report. 報表產生器報表設計師Report Builder Report Designer 資料集屬性對話方塊、查詢Dataset Properties Dialog Box, Query
繫結至共用資料集的不同共用資料來源。Bind to a different shared data source for a shared dataset. 報表管理員Report Manager 資料來源選擇頁面 (報表管理員)Data Source Selection Page (Report Manager)
驗證資料集參數的預設值。Verify default values for dataset parameters. 在報表產生器中開啟,或使用 URL 存取語法。Open in Report Builder or use URL access syntax. 例如:For example:

啟用快取Enable caching 報表管理員Report Manager 快取共用資料集 (SSRS)Cache Shared Datasets (SSRS)

快取頁面、共用資料集 (報表管理員)Caching Page, Shared Datasets (Report Manager)
建立或編輯快取重新整理計畫Create or edit a cache refresh plan 報表管理員Report Manager 快取重新整理選項 (報表管理員)Cache Refresh Options (Report Manager)
檢視共用資料集定義結構描述。View the shared dataset definition schema. 報表管理員Report Manager http://<reportserver>/shareddatasetdefinition.xsd
在 SharePoint 整合模式中,同步處理報表伺服器與 SharePoint 網站之間的共用資料集定義In SharePoint integrated mode, synchronize the shared dataset definition between the report server and the SharePoint site SharePoint 應用程式頁面SharePoint application pages 變更共用資料集項目屬性Change shared dataset item properties

變更快取選項Change cache options

變更共用資料來源Change the shared data source

比較共用資料集與其他報表伺服器項目Comparing Shared Datasets with Other Report Server Items

在報表伺服器上管理多個項目類型時,了解這些項目與其他報表伺服器項目有何異同,會很有助益。When you manage multiple types of items on a report server, it helps to understand how items are similar and how they are different from other report server items.

共用資料集以下列方式與共用資料來源和報表類似:Shared datasets are similar to shared data sources and reports in the following ways:

  • 共用資料集就像共用資料來源,是與使用的報表分開獨立管理。Like shared data sources, shared datasets are managed independently from the reports that they are used in. 在報表伺服器上管理共用資料集的一部分是能夠變更相依的共用資料來源,而不必編輯共用資料集定義。Part of managing a shared dataset on a report server is the ability to change the shared data source that it depends on without editing the shared dataset definition.

  • 共用資料集也跟報表一樣,可以進行快取。Like reports, shared datasets can be cached. 資料來源所需的認證必須符合快取的限制,而且必須為每個參數指定預設值。Credentials that are required by the data source must meet caching restrictions and default values must be specified for every parameter. 如需詳細資訊,請參閱 msdn.microsoft.com 之 快取共用資料集 (SSRS)For more information, see Cache Shared Datasets (SSRS).

  • 跟報表一樣,每次發生處理時,就會使用報表伺服器上目前的項目定義。Like reports, each time processing occurs, the current definition of the item on the report server is used. 如果變更共用資料集,使用該資料集的每個報表都會在處理報表時,使用報表伺服器上目前的定義。If you make changes to a shared dataset, each report that uses it will use the current definition on the report server when the report is processed. 如果已為共用資料集啟用快取,且變更共用資料集定義,則在快取中資料過期之前不會使用所做的變更。If caching is enabled for the shared dataset and you make changes to the shared dataset definition, the changes are not used until data in the cache expires. 您可以使用快取重新整理計劃,為多個報表提供一致的資料集。You can use cache refresh plans to help provide a consistent set of data for multiple reports.

    共用資料集是以下列方式與已發行的報表組件相異:Shared datasets are dissimilar to published report parts in the following way:

  • 與已發行的報表組件不同的是,當報表在報表撰寫用戶端中開啟時,報表伺服器上共用資料集定義中的變更不會觸發更新通知。Unlike published report parts, changes in the shared dataset definition on a report server do not trigger update notifications when the report is opened in a report authoring client. 當您執行報表時,會使用報表伺服器上目前共用資料集定義的資料。When you run the report, the data from the current shared dataset definition on the report server is used.

    共用資料集是以下列方式與訂閱類似:Shared datasets are similar to subscriptions in the following ways:

  • 共用資料集可以使用快取的項目特定和共用排程。Shared datasets can use item-specific and shared schedules for caching.

  • 共用資料集遵循與訂閱相同的參數值指定規則。Shared datasets follow the same rules for specifying parameter values as subscriptions do.

另請參閱See Also

報表伺服器內容管理 (SSRS 原生模式) Report Server Content Management (SSRS Native Mode)
在原生模式報表伺服器上授與權限Granting Permissions on a Native Mode Report Server