在 SharePoint Server 中使用 iFrame 內嵌 Power BI 報表伺服器 報表
在本文中,您將瞭解如何在 SharePoint 頁面中使用 iFrame 內嵌 Power BI 報表伺服器 報表。 如果您正在使用 SharePoint Online,則必須公開存取 Power BI 報表伺服器。 在 SharePoint Online 中,與 Power BI 服務 搭配運作的 Power BI 網頁元件不適用於 Power BI 報表伺服器。
必要條件
- Power BI 報表伺服器 安裝和設定。
- 已安裝適用於 Power BI 報表伺服器的Power BI Desktop。
- 已安裝 及設定 SharePoint Server 2013、2016、2019 或 Subscription Edition 環境 。
- 只有當檔模式設定為 IE11 (Edge) 模式或使用 SharePoint Online 時,才支援 Internet Explorer 11。 您可以使用其他支持的瀏覽器搭配 SharePoint 內部部署和 SharePoint Online。
建立 Power BI 報表 URL
從 GitHub 下載範例: 部落格示範。 選取 [Clone or download] \(複製或下載\),然後選取 [Download ZIP] \(下載 ZIP\)。
將檔案解壓縮,然後在Power BI Desktop 中開啟範例 .pbix 檔案,以取得 Power BI 報表伺服器。
將報表儲存至 Power BI 報表伺服器。
在 Power BI 報表伺服器 入口網站中檢視報表。
擷取 URL 參數
取得 URL 之後,您可以在 SharePoint 頁面中建立 iFrame 來裝載報表。 針對任何 Power BI 報表伺服器 報表 URL,新增下列查詢字串參數,以在 SharePoint iFrame 中內嵌報表:?rs:embed=true
。
例如: https://myserver/reports/powerbi/Sales?rs:embed=true
在 SharePoint iFrame 中內嵌報表
流覽至 SharePoint 網站內容 頁面。
選擇您要新增報表的頁面。
選取右上方的齒輪圖示,然後選取 [ 編輯] 頁面。
選取 [新增網頁元件]。
在 [類別] 底下,選取 [媒體和內容]。 在 [元件] 底下,選取 [內容編輯器],然後選取 [新增]。
選取 [按兩下這裡] 以新增內容。
從頂端功能表中,選取 [ 格式化文字],然後選取 [ 編輯來源]。
在 [ 編輯來源] 視窗中,將 iFrame 程式代碼貼到 HTML 來源中,然後選取 [ 確定]。
例如:
<iframe width="800" height="600" src="https://myserver/reports/powerbi/Sales?rs:embed=true" frameborder="0" allowFullScreen="true"></iframe>
在頂端功能表中,選取 [頁面],然後選取 [ 停止編輯]。
報表會出現在頁面上。
相關內容
- 建立 Power BI 報表伺服器的 Power BI 報表。
- 建立 Power BI 報表伺服器的編頁報表。
更多問題嗎? 請嘗試 Power BI 社群。