在 SharePoint Online 中嵌入報表網頁組件Embed with report web part in SharePoint Online

你可以使用 SharePoint Online 的 Power BI 新報表網頁組件,輕鬆地在 SharePoint Online 的網頁中內嵌互動式 Power BI 報表。With Power BI's new report web part for SharePoint Online, you can easily embed interactive Power BI reports in SharePoint Online pages.

當使用新的 [內嵌在 SharePoint Online 中] 選項時,內嵌的報表受會到全面性的防護,所以您可以輕鬆地建立安全的內部入口網站。When using the new Embed in SharePoint Online option, the embedded reports are fully secure so you can easily create secure internal portals.

需求Requirements

為了讓內嵌在 SharePoint Online 中的報表運作,必須達成幾項需求。There are a few requirements in order for Embed in SharePoint Online reports to work.

內嵌報表Embed your report

若要將報表嵌入 SharePoint Online,您必須先取得報表的 URL,然後在 SharePoint Online 中的新 Power BI 網頁組件使用該 URL。In order to embed your report into SharePoint Online, you first need to get the URL for the report and then use that URL with the new Power BI web part within SharePoint Online.

取得報表的 URLGet a URL to your report

  1. 在 Power BI 服務中檢視報表。View the report within the Power BI service.

  2. 選取 [檔案] 功能表項目。Select the File menu item.

  3. 選取 [內嵌於 SharePoint Online]。Select Embed in SharePoint Online.

    [檔案] 功能表

  4. 從對話方塊複製 URL。Copy URL from dialog.

    內嵌連結

將 Power BI 報表新增至 SharePoint Online 頁面Add the Power BI report to a SharePoint Online page

  1. 在 SharePoint Online 中開啟要使用的頁面,然後選取 [編輯]。Open the desired page in SharePoint Online and select Edit.

    SP 編輯頁面

    或者藉由選取 SharePoint Online 內的 [+ 新增],以建立新的新式網站頁面。Or, create a new modern site page by selecting + New within SharePoint Online.

    SP 新增頁面

  2. 選取 + 然後選取 [Power BI] Web 組件。Select + and select the Power BI web part.

    SP 新增網頁組件

  3. 選取 [新增報告] 。Select Add report.

    SP 新報表

  4. 將報表 URL 貼到屬性窗格。Paste the report URL into the property pane. 此報表 URL 是您從上述步驟所複製的 URL。This report URL is the URL you copied from the steps above. 報表會自動載入。The report loads automatically.

    SP 新增網頁組件屬性

  5. 選取 [發佈],讓 SharePoint Online 使用者能看見您所做的變更。Select Publish to make the change visible to your SharePoint Online users.

    載入的 SP 報表

授與報告存取權Grant access to reports

在 SharePoint Online 中內嵌報表,並不會自動授予使用者檢視報表的權限。Embedding a report in SharePoint Online does not automatically give users permission to view the report. 在 Power BI 服務中,具有檢視報表所需的權限。The permissions to view the report are set within the Power BI service.

重要

請務必檢閱可以看到 Power BI 服務內報表的成員,並將存取權授與未列出的成員。Make sure to review who can see the report within the Power BI service and grant access to those not listed.

有兩個方法可提供 Power BI 服務內報表的存取權。There are two ways to provide access to the report within the Power BI service. 如果您使用 Office 365 群組來建置 SharePoint Online 小組網站,則要將使用者列為 Power BI 服務內的應用程式工作區成員,及列出 SharePoint 頁面If you are using an Office 365 Group to build your SharePoint Online team site, you list the user as a member of the app workspace within the Power BI service and the SharePoint page. 如需詳細資訊,請參閱如何管理應用程式工作區For more information, see how to manage an app workspace.

或者,您可以透過在應用程式中內嵌報表來直接與使用者共用報表。Alternatively, you can share a report directly with users by embedding the report within an app. 若要在應用程式中內嵌報表,請按照幾個步驟操作。There are a few steps to follow for embedding a report within an app.

  1. 應用程式的作者是 Pro 使用者。The author of the app is a Pro user.

  2. 該作者在應用程式工作區中建立了報表。The author creates a report in an app workspace. 若要與 Power BI 免費使用者 共用,您需要將該應用程式工作區設定為 Premium 工作區To share with Power BI free users, the app workspace needs to be set as a Premium workspace.

  3. 作者發行應用程式,然後安裝它。The author publishes the app then installs it. 作者需要確保應用程式會安裝成可存取報告 URL (用於在內嵌在 SharePoint Online 中)。The author needs to make sure to install the app to have access to the report URL that is used to embed in SharePoint Online.

  4. 現在,所有使用者也都需要安裝應用程式。Now all end users need to install the app too. 不過,您可以使用 [自動安裝應用程式] 功能,將應用程式設定成替使用者預先安裝,您可以在 Power BI 管理入口網站 中啟用它。However, you can set the app to be preinstalled for end users by using the Install app automatically feature, which can be enabled in the Power BI admin portal.

    自動安裝應用程式

  5. 作者開啟應用程式,並移至報表。The author opens the app and goes to the report.

  6. 作者從應用程式安裝的報表複製內嵌報表 URL。The author copies the embed report URL from the report installed by the app. 請勿使用來自應用程式工作區的原始報表 URL。Do Not use the original report URL from the app workspace.

  7. 在 SharePoint Online 中建立新的小組網站。Create a new team site in SharePoint Online.

  8. 將從步驟 6 複製的 URL,新增到 Power BI 網頁組件。Add the report URL copied from step 6 to the Power BI web part.

  9. 新增要使用您建立的 Power BI 應用程式中 SharePoint Online 頁面上之資料的所有使用者和/或群組。Add all end users and/or groups who are going to consume the data on the SharePoint Online page and in the Power BI app you created.

    注意

    使用者或群組需要存取 SharePoint Online 頁面,及 Power BI 應用程式中的報表,才能看到 SharePoint 頁面上的報表。Users or groups need access to both the SharePoint Online page and the report in the Power BI app to see the report on the SharePoint page.

  10. 現在使用者可以移至 SharePoint Online 中的小組網站,並在頁面上檢視報表。Now the end user can go to the team site in SharePoint Online and view the reports on the page.

Multi-Factor AuthenticationMulti-factor authentication

如果您的 Power BI 環境需要您使用多重要素驗證進行登入,您可能會受要求使用安全性裝置進行登入,以驗證您的身分識別。If your Power BI environment requires you to sign in using multi-factor authentication, you may be asked to sign in with a security device to verify your identity. 如果您沒有使用多重要素驗證登入 SharePoint.Online,但您的 Power BI 環境需要使用安全性裝置來驗證的帳戶,就會發生此情況。This occurs if you did not sign in to SharePoint Online using multi-factor authentication but your Power BI environment requires an account validated by a security device.

注意

Azure Active Directory 2.0 尚不支援多重要素驗證。Multi-factor authentication is not yet supported with Azure Active Directory 2.0. 使用者會收到指出「錯誤」的訊息。Users receive a message saying error. 如果使用者使用其安全性裝置再次登入 SharePoint Online ,則可以檢視報表。If the user signs in again to SharePoint Online using their security device, they may be able to view the report.

網頁組件設定Web part settings

以下是 SharePoint Online 的 Power BI 網頁組件之可調整設定的描述。Below is a description of the settings that can be adjusted for the Power BI web part for SharePoint Online.

SP 網頁組件屬性

屬性Property 描述Description
頁面名稱Page name 設定網頁組件所顯示的預設頁面。Sets the default page that is shown by the web part. 從下拉式清單中選取一個值。Select a value from the drop-down. 如果沒有顯示任何頁面,可能是您的報表只有一個頁面,或您所貼上的 URL 包含頁面名稱。If no pages are displayed, either your report has one page, or the URL you pasted contains a page name. 從 URL 移除報表區段,以選取特定頁面。Remove the report section from the URL to select a specific page.
顯示Display 調整報表如何被納入 SharePoint Online 頁面的選項。Option to adjust how the report is fit within the SharePoint Online page.
顯示功能窗格Show Navigation Pane 顯示或隱藏頁面功能窗格。Shows or hides the page navigation pane.
顯示篩選窗格Show Filter Pane 顯示或隱藏篩選窗格。Shows or hides the filter pane.

不會載入的報表Reports that do not load

您的報表可能未在 Power BI Web 組件中載入,並可能顯示下列訊息。Your report may not load within the Power BI web part and may show the following message.

此內容無法使用。This content isn't available.

找不到報表的訊息

有兩個常見的原因會導致此訊息的出現。There are two common reasons for this message.

  1. 您沒有存取此儀表板的權限。You do not have access to the report.
  2. 報表已刪除。The report was deleted.

請連絡 SharePoint Online 頁面的擁有者,以協助您解決問題。Contact the owner of the SharePoint Online page to help you resolve the issue.

授權Licensing

在 SharePoint 中檢視報表的使用者需要 Power BI Pro 授權,或者內容需要位於 Power BI Premium 容量 (EM 或 P SKU) 的工作空間中。Users viewing a report in SharePoint need either a Power BI Pro license or the content needs to be in a workspace that's in a Power BI Premium capacity (EM or P SKU).

已知的問題及限制Known issues and limitations

  • 錯誤:「An error occurred, please try logging out and back in and then revisiting this page. (發生錯誤。請登出再登入,然後再次前往此頁面。)Error: "An error occurred, please try logging out and back in and then revisiting this page. 相互關聯識別碼: 未定義,http 回應狀態:400,伺服器錯誤碼 10001,訊息:遺漏重新整理權杖」Correlation ID: undefined, http response status: 400, server error code 10001, message: Missing refresh token"

    如果您收到這個錯誤,請嘗試下列其中一個疑難排解步驟。If you receive this error, try one of the troubleshooting steps below.

    1. 登出再登入 SharePoint。Sign out of SharePoint and sign back in. 請務必關閉所有瀏覽器視窗,然後再重新登入。Be sure to close all browser windows before signing back in.

    2. 若您的使用者帳戶需要多重要素驗證 (MFA),請確定您是使用多重要素驗證裝置 (手機應用程式、智慧卡等等) 登入 SharePoint。If your user account requires multi-factor authentication (MFA), ensure you sign in to SharePoint using your multi-factor authentication device (phone app, smart card, etc.)

    3. 不支援 Azure B2B 來賓使用者帳戶。Azure B2B Guest users accounts are not supported. 使用者看到的 Power BI 標誌會顯示載入的部分,但不會顯示報表。Users see the Power BI logo that shows the part is loading, but it doesn't show the report.

  • Power BI 與 SharePoint Online 支援的當地語系化語言不盡相同。Power BI does not support the same localized languages that SharePoint Online does. 因此,您可能會在內嵌報表中看到未適當當地語系化的內容。As a result, you may not see proper localization within the embedded report.

  • 您若使用 Internet Explorer 10,可能會遇到問題。You may encounter issues if using Internet Explorer 10. 您可以參閱 Power BIOffice 365 的瀏覽器支援。You can look at the browsers support for Power BI and for Office 365.

  • 國家/地區雲端不提供 Power BI Web 組件。The Power BI web part is not available for national clouds.

  • 此 Web 組件不支援傳統的 SharePoint 伺服器。The classic SharePoint Server is not supported with this web part.

  • URL 篩選不受到 SPO Web 組件支援。URL filters are not supported with the SPO web part.

後續步驟Next steps

有其他問題嗎?More questions? 嘗試在 Power BI 社群提問Try asking the Power BI Community