使用 Visio Services 與 SharePoint Server 的外部清單Use Visio Services with external lists in SharePoint Server

摘要:使用 Microsoft Business Connectivity Services 連線至 Visio 中的外部清單,並使用 Visio Services 轉譯在瀏覽器中的圖表。Summary: Connect to an external list in Visio by using Microsoft Business Connectivity Services and render the diagram in a browser by using Visio Services.

本文件說明將 Visio 圖表連線至 SharePoint Server 2013 或 SharePoint Server 2016 中的外部清單所需的程序。This document describes the procedures necessary to connect a Visio diagram to an external list in SharePoint Server 2013 or SharePoint Server 2016.

將外部清單是已使用 Microsoft Business Connectivity Services 連線至 SharePoint 清單的 SharePoint Server (例如 SQL Server 資料表) 外部資料來源。資料連線的外部清單同時建立和使用 Visual Studio 或 SharePoint Designer 2013。連接資訊是受管理和儲存使用 Business Data Connectivity service、 Business Connectivity Services in SharePoint Server 的元件。An external list is a data source outside SharePoint Server (for example, a SQL Server table) that has been connected to a SharePoint list by using Microsoft Business Connectivity Services. The data connection and the external list are both created by using Visual Studio or SharePoint Designer 2013. The connection information is managed and stored by using the Business Data Connectivity service, a component of Business Connectivity Services in SharePoint Server.

開始之前Before you begin

下列服務應用程式必須位於執行及設定 SharePoint 伺服器陣列上:The following service applications must be running and configured on your SharePoint Server farm:

  • Business Data Connectivity ServiceBusiness Data Connectivity service

  • Visio Graphics ServiceVisio Graphics Service

  • Secure Store ServiceSecure Store Service

您也需要下列網域帳戶:You also need the following domain accounts:

  • 具有資料來源的讀取權限的帳戶。此帳戶儲存在 Secure Store 中使用由 Microsoft Business Connectivity Services。An account that has read access to your data source. This account is stored in Secure Store for use by Microsoft Business Connectivity Services.

  • 具有您要建立外部清單的 SharePoint 網站之「設計」權限的使用者帳戶。A user account that has Design permissions to the SharePoint site where you want to create the external list.

  • 具有 SharePoint 管理中心網站上設定各種設定伺服器陣列管理員權限的帳戶。An account that has Farm Administrator permissions to configure various settings on the SharePoint Central Administration website.

設定 Secure Store 目標應用程式Configure a Secure Store target application

Business Data Connectivity service 外部內容類型會使用儲存在 Secure Store 存取資料來源的認證。您必須建立外部內容類型,以用於存取這些認證的 Secure Store 目標應用程式。The Business Data Connectivity service External Content Type uses credentials that are stored in Secure Store to access the data source. You must create a Secure Store target application for the External Content Type to use in accessing these credentials.

請使用下列程序建立目標應用程式。Use the following procedure to create the target application.

若要建立 Secure Store 目標應用程式To create a Secure Store Target Application

  1. 在管理中心的 [應用程式管理] 區段中,按一下 [管理服務應用程式]。In Central Administration, in the Application Management section, click Manage Service Applications.

  2. 按一下 [Secure Store Service 應用程式]。Click the Secure Store service application.

  3. 在功能區上的 [管理目標應用程式] 群組中按一下 [新增]In the Manage Target Applications group on the ribbon, click New.

  4. 在 [目標應用程式識別碼] 方塊中輸入此目標應用程式的唯一識別碼。記下您在這裡 ; 使用的名稱您將需要建立外部內容類型時。In the Target Application ID box, type a unique identifier for this target application. Note the name that you use here; you will need it when you create the External Content Type.

  5. 輸入顯示名稱] 和 [連絡人電子郵件地址Type a Display Name and Contact E-Mail address.

  6. 從 [目標應用程式類型] 清單中選取群組From the Target Application Type list, select Group.

  7. [下一步]Click Next.

  8. 在 [欄位名稱] 頁面上保留預設設定] 和 [下一步On the Field Names page, keep the default settings and then click Next.

  9. 在 [目標應用程式管理員] 方塊中輸入您要管理此目標應用程式的使用者名稱。In the Target Application Administrators box, type the names of the users whom you want to be able to administer this target application.

  10. 在 [成員] 方塊中輸入您要允許以觸發重新整理資料的使用者名稱。(亦即使用者檢視 Visio 圖表您建立。)In the Members box, type the names of the users whom you want to allow to trigger data refresh. (That is, the users who will be viewing the Visio diagram that you create.)

  11. 按一下 [ OK ]。Click OK.

建立目標應用程式之後,您必須設定所要與此目標應用程式相關聯的認證。在此例中,您必須使用網域帳戶具有您想要透過 Microsoft Business Connectivity Services 連線至資料來源的讀取權限。After the target application has been created, you must set the credentials that are to be associated with this target application. In this case, you must use a domain account that has read access to the data source that you want to connect to through Microsoft Business Connectivity Services.

設定目標應用程式的認證To set the credentials for the target application

  1. 在 [安全認證儲存管理] 頁面上選取您剛才建立之目標應用程式] 旁的核取方塊。On the Secure Store administration page, select the check box next to the target application that you just created.

  2. 在 [功能區上的 [認證] 群組中,按一下 [設定]。In the Credentials group on the ribbon, click Set.

  3. 在 [ Windows 使用者名稱] 方塊中,輸入可存取資料來源的網域帳戶。In the Windows User Name box, type the domain account that has access to your data source.

  4. 輸入該帳戶的密碼並加以確認。Type and confirm the password for that account.

  5. 按一下 [ OK ]。Click OK.

設定 Business Data Connectivity service 中繼資料儲存區權限Configure Business Data Connectivity service metadata store permissions

您必須以具有權限的 Business Data Connectivity service 中繼資料存放區的使用者帳戶建立外部內容類型。使用下列程序授與使用者的 Business Data Connectivity service 中繼資料存放區的權限。(您可以略過此步驟若已具有這些權限的使用者帳戶。)You must create the External Content Type with a user account that has permissions to the Business Data Connectivity service metadata store. Use the following procedure to grant a user permissions to the Business Data Connectivity service metadata store. (You can skip this step if you already have a user account that has these permissions.)

Business Data Connectivity service 中繼資料儲存區的權限授與使用者To grant a user permissions to the Business Data Connectivity service metadata store

  1. 在管理中心的 [應用程式管理] 區段中,按一下 [管理服務應用程式]。In Central Administration, in the Application Management section, click Manage Service Applications.

  2. 按一下 [Business Data Connectivity service 服務應用程式。Click the Business Data Connectivity service service application.

  3. 在功能區的權限] 區段中,按一下 [設定中繼資料儲存區權限In the Permissions section of the ribbon, click Set Metadata Store Permissions.

  4. 輸入您要授與權限的使用者帳戶,然後按一下 [新增]Type the user account to which you want to grant permissions, and then click Add.

  5. 選取您剛新增的使用者帳戶,然後選取 [編輯] 和 [執行] 核取方塊。Select the user account that you just added, and then select the Edit and Execute check boxes.

  6. 按一下 [ OK ]。Click OK.

請注意編輯,則需要建立或修改外部內容類型的 Business Data Connectivity service 高度權限 」 權限。我們建議您先設計或變更網站時設定編輯權限並移除不需要使用者的編輯權限。為查詢外部內容類型所需執行」 權限。Note that Edit is a highly privileged permission that is required to create or modify External Content Types in Business Data Connectivity service. We recommend that you set Edit permissions when the site is first designed or changed and then remove the Edit permissions for users who do not require it. Execute permissions are required to query the External Content Type.

建立外部內容類型Create an External Content Type

您的使用者帳戶具有 Business Data Connectivity service 中繼資料儲存區權限後,您可以建立外部內容類型。若要完成本節中的程序,您的帳戶也必須設計權限您預計要建立外部清單的 SharePoint 網站。如果您想要設定的權限清單 (選擇性步驟) 必須完全控制」 權限在網站上。After your user account has permissions to the Business Data Connectivity service metadata store, you can create the External Content Type. To complete the procedures in this section, your account must also have Design permissions on the SharePoint site where you plan to create the external list. If you want to set permissions on the list (an optional step) you must have Full Control permissions on the site.

建立和管理 SharePoint Designer 2013 或 Visual Studio 2012 中的 Business Data Connectivity service 的外部內容類型。本範例會使用 SQL Server 資料來源,並使用 SharePoint Designer 2013 建立外部內容類型。External content types for Business Data Connectivity service are created and managed in SharePoint Designer 2013 or Visual Studio 2012. This example uses a SQL Server data source, and the external content type is created by using SharePoint Designer 2013.

下列程序說明如何建立及設定外部內容類型。遵循這些程序執行 SharePoint Designer 2013 的電腦上。The following procedures describe how to create and configure an External Content Type. Follow these procedures on a computer that is running SharePoint Designer 2013.

若要建立外部內容類型To create an External Content Type

  1. 使用 Business Data Connectivity service 中繼資料存放區中有您要建立外部清單的 SharePoint 網站上 「設計」 權限與權限的帳戶登入電腦。Log on to a computer by using an account that has Design permissions on the SharePoint site where you want to create the external list and permissions to the Business Data Connectivity service metadata store.

  2. 開啟 SharePoint Designer 2013。Open SharePoint Designer 2013.

  3. 在 [開啟 SharePoint 網站] 區段中,按一下 [開啟網站]。In the Open SharePoint Site section, click Open Site.

  4. 在 [網站名稱] 方塊中輸入您要建立外部清單中,網站的 URL 及 [開啟In the Site name box, type the URL of the site where you want to create the external list, and then click Open.

  5. 在左導覽列中,按一下 [外部內容類型In the left navigation, click External Content Types.

  6. 在功能區的 [新增] 區段中,按一下 [外部內容類型In the New section of the ribbon, click External Content Type.

  7. 輸入的內容類型的名稱顯示名稱Type a Name and Display Name for the content type.

  8. 按一下 [按一下此處可探索外部資料來源並定義作業]。Click Click here to discover external data sources and define operations.

  9. 按一下 [新增連線]。Click Add Connection.

  10. 從 [資料來源類型] 清單中選取您的資料來源類型。(此範例會假設 SQL Server 資料來源)。Select your data source type from the Data Source Type list. (This example assumes a SQL Server data source.)

  11. SQL Server 連線] 對話方塊中:In the SQL Server Connection dialog box:

    • 在 [資料庫伺服器] 方塊中輸入資料庫伺服器的名稱。In the Database Server box, type the name of your database server.

    • 在 [資料庫名稱] 方塊中輸入資料庫的名稱。In the Database Name box, type the name of your database.

    • 選取使用模擬 Windows 身分識別連線]選項。Select the Connect with Impersonated Windows Identity option.

    • 在 [安全認證儲存應用程式識別碼] 方塊中輸入您建立的安全認證儲存目標應用程式的識別碼。In the Secure Store Application ID box, type the ID of the Secure Store target application that you created.

    • 按一下 [ OK ]。Click OK.

  12. 在 [資料來源檔案總管中,尋找您想要連線至表格。In the Data Source Explorer, find the table that you want to connect to.

  13. 以滑鼠右鍵按一下資料表,然後按一下 [建立所有作業Right-click the table and then click Create All Operations.

  14. 完成所有作業精靈]。Complete the All operations wizard.

  15. 當您完成精靈] 的 [檔案] 功能表上按一下 [儲存When you have completed the wizard, on the File menu, click Save.

建立外部內容類型之後,下一步是據此建立外部清單。After you have created the External Content Type, the next step is to create an external list based on it.

若要建立外部清單To create an external list

  1. SharePoint Designer 的左的功能窗格中,按一下 [外部內容類型。(如果您剛才建立之外部內容類型未出現在清單中,您可能必須重新整理清單。)In SharePoint Designer, in the left navigation pane, click External Content Types. (If the External Content Type that you just created does not appear in the list, you may have to refresh the list.)

  2. 以滑鼠右鍵按一下您建立之外部內容類型,然後按一下 [外部清單Right-click the External Content Type that you created, and then click External List.

  3. 輸入 [] 清單中的名稱,然後按一下 [確定]Type a name for the list, and then click OK.

  4. (選用) 按一下 [這個清單的權限可設定清單的權限。(根據預設,清單繼承的權限的網站。)Optionally, click Permissions for this list to set list permissions. (By default, the list inherits permissions from the site.)

設定 Business Data Connectivity service 物件權限Configure Business Data Connectivity service object permissions

誰將 SharePoint 中使用外部清單或人員檢視 Visio 圖表連線至該清單的使用者必須具備外部內容類型的權限。使用下列程序的使用者權限授與 Business Data Connectivity service 的外部內容類型。Users who will be using the external list in SharePoint or who will be viewing a Visio diagram connected to that list must have permissions to the External Content Type. Use the following procedure to grant the users permissions to the External Content Type in Business Data Connectivity service.

授與使用者權限 Business Data Connectivity service 的外部內容類型To grant a user permissions to the Business Data Connectivity service External Content Type

  1. 在管理中心的 [應用程式管理] 區段中,按一下 [管理服務應用程式]。In Central Administration, in the Application Management section, click Manage Service Applications.

  2. 按一下 [Business Data Connectivity service 服務應用程式。Click the Business Data Connectivity service service application.

  3. 按一下您建立的外部內容類型。Click the External Content Type that you created.

  4. 在功能區上的 [權限] 群組中按一下 [設定物件權限In the Permissions group on the ribbon, click Set Object Permissions.

  5. 輸入的使用者帳戶或您要授與權限、 Active Directory 群組,然後按一下 [新增]Type the user account or an Active Directory group to which you want to grant permissions, and then click Add.

  6. 選取您剛新增的使用者帳戶,然後選取 [執行] 核取方塊。Select the user account that you just added, and then select the Execute check box.

  7. 按一下 [ OK ]。Click OK.

在 Visio 中連線至外部清單Connect to the external list in Visio

外部清單現已提供在 SharePoint 網站中。您現在可以從 Visio 連線至清單。The external list is now available on the SharePoint site. You can now connect to the list from Visio.

連線至 Visio 中的外部清單To connect to an external list in Visio

  1. 在 Visio 中,在 [資料] 索引標籤按一下 [連結資料至圖形In Visio, on the Data tab, click Link Data to Shapes.

  2. 選擇 [ Microsoft SharePoint Foundation清單] 選項,並再按 [下一步Choose the Microsoft SharePoint Foundation list option, and then click Next.

  3. [選取站台] 頁面上輸入您的外部清單所在之 SharePoint 網站的 URL 並再按 [下一步On the Select a site page, type the URL for the SharePoint site where your external list is located, and then click Next.

  4. 選取 [清單] 頁面上選擇您建立的外部清單和 [完成時間On the Select a list page, choose the external list that you created, and then click Finish.

外部清單中的資料現在會提供 Visio 並將其連結至圖形。您已連結資料至圖形後下, 一步是將檔案儲存至 SharePoint 文件庫。The data from the external list is now available in Visio and you can link it to your shapes. After you have linked the data to shapes, the next step is to save the file to a SharePoint document library.

將圖表儲存至 SharePoint 文件庫To save a diagram to a SharePoint document library

  1. 在 Visio 中,按一下 [檔案] 和 [儲存In Visio, click File, and then click Save.

  2. 按一下 [電腦] 和 [瀏覽]Click Computer, and then click Browse.

  3. 在 [另存新檔] 對話方塊頂端的位置方塊中輸入 SharePoint 文件庫的 URL 並按 Enter。Type the URL of the SharePoint document library in the location box at the top of the Save As dialog box, and then press Enter.

  4. 輸入檔案名稱,和 [儲存Type a file name, and then click Save.

將圖表儲存至 SharePoint 文件庫之後,您可以移至文件庫並按一下 [以使用 Visio Services 在瀏覽器中呈現該 Visio 檔案。After the diagram has been saved to the SharePoint document library, you can go to the document library and click the Visio file to render it in a browser by using Visio Services.