建立及管理共用資料來源 (SharePoint 整合模式的 Reporting Services)Create and Manage Shared Data Sources (Reporting Services in SharePoint Integrated Mode)

當您從 SharePoint 文件庫執行報表時,可以在報表內部或連結到報表的外部檔案中定義連接資訊。When you run a report from a SharePoint library, connection information can be defined inside the report or in an external file that is linked to the report. 如果連接資訊內嵌於報表中,它就稱為自訂資料來源。If the connection information is embedded within the report, it is called a custom data source. 如果連接資訊定義於外部檔案中,它就稱為共用資料來源。If the connection information is defined in an external file, it is called a shared data source. 外部檔案可以是報表伺服器資料來源 (.rsds) 檔案或 Office 資料連線 (.odc) 檔案。The external file can be a report server data source (.rsds) file or an Office Data Connection (.odc) file.

.rsds 檔類似 .rds 檔,但結構描述不同。An .rsds file is similar to an .rds file, but it has a different schema. 若要建立 .rsds 檔,您可以將 .rds 檔從報表設計師或模型設計師中發行到 SharePoint 文件庫 (便會根據原始 .rds 檔建立新的 .rsds 檔)。To create an .rsds file, you can publish an .rds from Report Designer or Model Designer to a SharePoint library (a new .rsds file is created from the original .rds file). 或者,您可以在 SharePoint 網站的文件庫中建立新檔案。Or, you can create a new file in a library on a SharePoint Site.

當您建立或發行共用資料來源之後,就可以編輯連接屬性,而且如果已經不需要,還可以刪除該檔案。After you create or publish a shared data source, you can edit connection properties or delete the file if it is no longer used. 刪除共用資料來源之前,您應該先判斷是否有報表和報表模型使用此共用資料來源。Before you delete a shared data source, you should determine whether it is used by reports and report models. 您可以檢視參考到共用資料來源的相依項目來判斷。You can do this by viewing dependent items that reference the shared data source.

雖然相依項目清單會告訴您是否有項目參考到共用資料來源,但是並不會告訴您此項目目前是否使用中。Although the list of dependent items tells you whether the shared data source is referenced, it does not tell you whether the item is actively used. 若要判斷共用資料來源或模型目前是否使用中,您可以檢閱報表伺服器電腦上的記錄檔。To determine whether the shared data source or model is actively used, you can review the log files on the report server computer. 如果您無法存取這些記錄檔,或者這些檔案沒有包含所需的資訊,請考慮在您判斷報表的實際狀態時,將報表移至無法存取的資料夾。If you do not have access to the log files or if the files do not contain the information you want, consider moving the report to an inaccessible folder while you determine its actual status.

若要建立共用資料來源 (.rsds) 檔案 (SharePoint 2010)To create a shared data source (.rsds) file (SharePoint 2010)

  1. 按一下文件庫功能區上的 [文件] 索引標籤。Click the Documents tab on the library ribbon.

  2. 在 [新增文件] 功能表上,按一下 [報表資料來源]On the New Document menu, click Report Data Source

    注意

    如果您沒有在功能表上看見 [報表資料來源] 項目,表示報表資料來源內容類型尚未啟用。If you do not see the Report Data Source item on the menu, the report data source content type has not been enabled. 如需詳細資訊,請參閱 < 將報表伺服器內容類型加入至文件庫(以 SharePoint 整合模式的 Reporting Services)For more information, see Add Report Server Content Types to a Library (Reporting Services in SharePoint Integrated Mode).

  3. 在 [名稱] 中,輸入 .rsds 檔的描述性名稱。In Name, enter a descriptive name for the .rsds file.

  4. 在 [資料來源類型] 的清單中,選取資料來源的類型。In Data Source Type, select the type of data source from the list. 如需詳細資訊,請參閱 Reporting Services (SSRS) 支援的資料來源For more information, see Data Sources Supported by Reporting Services (SSRS).

  5. 在 [連接字串] 中,指定資料來源的指標以及其他建立外部資料來源連線必要的任何設定。In Connection String, specify a pointer to the data source and any other settings that are necessary for establishing a connection to the external data source. 您所使用的資料來源類型會決定連接字串的語法。The type of data source you are using determines the syntax of the connection string. 如需詳細資訊和範例,請參閱 < 資料連接、 資料來源和 Reporting Services 中的連接字串For more information and examples, see Data Connections, Data Sources, and Connection Strings in Reporting Services.

  6. 在 [認證] 中,指定報表伺服器取得認證來存取外部資料來源的方式。In Credentials, specify how the report server obtains credentials to access the external data source. 認證可以針對自動報表處理而儲存、提示、整合或設定。Credentials can be stored, prompted, integrated, or configured for unattended report processing.

    • 如果您想要使用開啟報表之使用者的認證來存取資料,請選取 [Windows 驗證 (整合式)]。Select Windows authentication (integrated) if you want to access the data using the credentials of the user who opened the report. 如果 SharePoint 網站或伺服陣列使用表單驗證或透過受信任帳戶連接到報表伺服器,請勿選取這個選項。Do not select this option if the SharePoint site or farm uses forms authentication or connects to the report server through a trusted account. 如果您想要排程這個報表的訂閱或資料處理,請勿選取這個選項。Do not select this option if you want to schedule subscription or data processing for this report. 在針對網域啟用 Kerberos 驗證時,或者資料來源與報表伺服器是在同一部電腦上時,此選項具有最佳的效能。This option works best when Kerberos authentication is enabled for your domain, or when the data source is on the same computer as the report server. 如果未啟用 Kerberos 驗證,Windows 認證只能傳遞至一部其他電腦。If Kerberos authentication is not enabled, Windows credentials can only be passed to one other computer. 這表示,如果外部資料來源位於另一部需要其他連接的電腦上,您就會收到錯誤而非所預期的資料。This means that if the external data source is on another computer, requiring an additional connection, you will get an error instead of the data you expect.

    • 如果您希望使用者在每次執行報表時輸入自己的認證,請選取 [提示認證]。Select Prompt for credentials if you want the user to enter his or her credentials each time he or she runs the report. 如果您想要排程這個報表的訂閱或資料處理,請勿選取這個選項。Do not select this option if you want to schedule subscription or data processing for this report.

    • 如果您想要使用單一認證集來存取這個資料,請選取 [預存認證]。Select Stored credentials if you want to access the data using a single set of credentials. 認證會先經過加密,然後再儲存。The credentials are encrypted before they are stored. 您可以選取決定預存認證之驗證方式的選項。You can select options that determine how the stored credentials are authenticated. 如果預存認證屬於 Windows 使用者帳戶,請選取 [當做 Windows 認證使用]。Select Use as Windows credentials if the stored credentials belong to a Windows user account. 如果您想在資料庫伺服器上設定執行內容,請選取 [設定執行內容到這個帳戶]。Select Set execution context to this account if you want to set the execution context on the database server. 針對[SQL Server]SQL Server資料庫,此選項會設定 SETUSER 函數。For [SQL Server]SQL Server databases, this option sets the SETUSER function. 如需詳細資訊,請參閱 SETUSER (Transact-SQL)For more information, see SETUSER (Transact-SQL).

    • 如果您想要在連接字串中指定認證,或是想要使用報表伺服器上設定的最低權限帳戶來執行報表,請選取 [不需要認證]。Select Credentials are not required if you want to specify credentials in the connection string, or if you want to run the report using a least-privilege account that is configured on the report server. 如果這個帳戶並未在報表伺服器上設定,系統就會提示使用者輸入認證,而且您針對該報表定義的所有排程作業將不會執行。If this account is not configured on the report server, users will be prompted for credentials and any scheduled operations that you define for the report will not run.

  7. 如果您想要讓資料來源成為使用中,請選取 [啟用此資料來源]。Select Enable this data source if you want the data source to be active. 如果資料來源已設定,但是非使用中,當使用者嘗試使用以資料來源為基礎的報表時,他們就會看見錯誤訊息。If the data source is configured but not active, users will see an error message when they attempt to use a report based on the data source.

  8. 按一下 [測試連線] 按鈕,驗證資料來源設定。Click the Test Connection button to validate the data source configuration.

    注意

    [測試連接] 按鈕不支援 XML 資料來源類型。The Test Connection button is not supported for the XML data source type.

  9. 按一下 [確定],儲存建立的共用資料來源。Click OK to save create the shared data source.

若要檢視相依項目To view dependent items

  1. 開啟包含 .rsds 檔案的文件庫。Open the library that contains the .rsds file.

  2. 指向共用資料來源。Point to the shared data source.

  3. 按一下即可顯示向下箭頭,然後選取 [檢視相依項目]。Click to display a down arrow, and select View Dependent Items.

    若為報表模型,相依項目的清單就會顯示在報表產生器中建立的報表。For report models, the list of dependent items shows the reports that were created in Report Builder. 若為共用資料來源,相依項目清單可能會同時包括報表和報表模型。For shared data sources, the dependent items list can include both reports and report models.

刪除共用資料來源 (.rsds) 檔案To delete a shared data source (.rsds) file

  1. 開啟包含 .rsds 檔案的文件庫。Open the library that contains the .rsds file.

  2. 指向共用資料來源。Point to the shared data source.

  3. 按一下即可顯示向下箭頭,然後按一下 [刪除]。Click to display a down arrow, and click Delete.

    如果您不小心刪除了想要保留的共用資料來源,可以建立包含相同連接資訊的新共用資料來源。If you mistakenly delete a shared data source that you meant to keep, you can create a new one that contains the same connection information. 在您重新建立共用資料來源之後,就必須開啟使用該資料來源的每個報表和模型,然後選取共用資料來源。After you recreate the shared data source, you must open each report and model that used that data source and select the shared data source. 新的共用資料來源項目的名稱、認證或連接字串語法可以與之前刪除的資料來源不同。The new shared data source item can have a different name, credentials, or connection string syntax from the one you delete. 只要連接解析成相同的資料來源,資料來源屬性可能會與原始值不同。As long as the connection resolves to the same data source, data source properties can vary from the original values.

    刪除報表模型時,請特別小心。Use caution when deleting a report model. 如果您刪除模型,就不能再於報表產生器中,開啟和修改以該模型為基礎的任何報表。If you delete a model, you can no longer open and modify any reports that are based on that model in Report Builder. 如果您不慎刪除了現有報表所使用的模型,就必須重新產生該模型,重新建立並儲存使用該模型的任何報表,然後重新指定想要使用的任何模型項目安全性。If you inadvertently delete a model that is used by existing reports, you must regenerate the model, re-create and save any reports that use the model, and re-specify any model item security that you want to use. 您不能只是重新產生模型,然後將它附加到現有的報表。You cannot simply regenerate the model and then attach it to an existing report.

另請參閱See Also

指定報表資料來源的認證及連線資訊Specify Credential and Connection Information for Report Data Sources