Power BI 的 [發行至 Web]Publish to web from Power BI

透過 Power BI [發行至 Web],您可以輕鬆地使用任何裝置,線上內嵌互動式 Power BI 視覺效果,例如內嵌至部落格文章、網站,或透過電子郵件、社交媒體傳送。With Power BI Publish to web, you can easily embed interactive Power BI visualizations online, such as in blog posts, websites, through emails or social media, on any device.

您也可以輕鬆編輯、更新、重新整理或取消共用已發佈的視覺效果。You can also easily edit, update, refresh, or unshare your published visuals.


使用 [發行至 Web] 時,網際網路上的任何人都可以檢視您發佈的報表或視覺效果。When you use Publish to web, the report or visual you publish can be viewed by anyone on the Internet. 無須驗證即可檢視這些報表。There is no authentication used when viewing these reports. 使用 [發佈至網路] 時,請只針對網際網路上所有人 (未經驗證的一般大眾) 皆可檢視的報表和資料。Only use Publish to web with reports and data that the anyone on the Internet (unauthenticated members of the public) should be able to see. 這包括報表中所彙總的詳細等級資料。This includes detail level data that is aggregated in your reports. 發行此報表之前,請確認您有公開分享資料及視覺效果的權限。Before publishing this report, ensure you have the right to share the data and visualizations publicly. 請勿發行機密或專屬資訊。Do not publish confidential or proprietary information. 如有疑問,請先核查貴組織的原則再發行。If in doubt, check your organization's policies before publishing.


若要安全地將您的內容內嵌在內部入口網站或網站,請使用內嵌內嵌於 SharePoint Online 中選項。To embed your content securely in an internal portal or website, use the Embed or Embed in SharePoint Online options. 這可確保當您的使用者檢視您的內部資料時,所有權限與資料安全性都強制受保護。This ensures all permissions and data security is enforced when your users are viewing your internal data.

如何使用 [發佈至網路]How to use Publish to Web

您可以在個人或群組工作區中可編輯的報表使用 [發行至 Web] 功能。Publish to web is available on reports in your personal or group workspaces that you can edit. 與您共用的報表或依賴資料列層級安全性保護資料的報表,不能使用 [發行至 Web]。You cannot use Publish to web with reports that were shared with you, or reports that rely on row level security to secure the data. 請參閱下面的<限制>一節以取得不支援 [發行至 Web] 的完整案例清單。See the Limitations section below for a complete list of cases where Publish to web isn't supported. 使用 [發佈至 Wb] 之前,請先檢閱此文章稍早的<警告>。Review the Warning earlier in this article before using Publish to web.

在以下 短片中,您可以觀賞這項功能的運作方式。You can watch how this feature works in the following short video. 然後依循下列步驟,自己試試看。Then, follow the steps below to try it yourself.

下列步驟說明如何使用 [ 發佈至網路]。The following steps describe how to use Publish to web.

  1. 在您工作區中可編輯報表上,選取 [檔案] [發行至 Web].On a report in your workspace that you can edit, select File > Publish to web.


  2. 如以下對話方塊所示,檢閱對話方塊中的內容,選取 [ 建立內嵌程式碼 ]。Review the content on the dialog, and select Create embed code as shown in the following dialog.


  3. 檢閱以下對話方塊所示的警告,並確認資料是否可以內嵌在公開網站上。Review the warning, shown in the following dialog, and confirm that the data is okay to embed in a public website. 如果可以,請選取 [ 發佈]。If so, select Publish.


  4. 然後會出現一個對話方塊,提供連結,您可以透過電子郵件傳送該連結、內嵌於程式碼 (例如 iFrame),或直接貼在網頁或部落格上。A dialog appears that provides a link that can be sent in email, embedded in code (such as an iFrame), or that you can paste directly into your web page or blog.


  5. 如果您先前已針對報表建立內嵌程式碼,該程式碼會立即顯示。If you’ve previously created an embed code for the report, the embed code quickly appears. 每個報表只能建立一個內嵌程式碼。You can only create one embed code for each report.


檢視模式的秘訣和訣竅Tips and Tricks for View modes

在部落格文章中內嵌內容時,通常需要符合特定螢幕大小。When you embed content within a blog post, you typically need to fit it within a specific size of the screen. 您可以視需要在 iFrame 標籤內調整高度和寬度,但您可能也需要確保報表符合 iFrame 的特定區域大小,因此編輯報表時,您還必須設定適當的檢視模式。You can also adjust the height and the width in the iFrame tag as needed, but you may also need to ensure your report fits within the given area of the iFrame, so you also need to set an appropriate View Mode when editing the report.

下表提供檢視模式的相關指南,以及內嵌後的顯示方式。The following table provides guidance about the View Mode, and how it will appear when embedded.

檢視模式View Mode 內嵌時的外觀How it looks when embedded
PtW6b [調整成一頁] 會使用您報表頁面的高度和寬度。Fit to page will respect the page height and width of your report. 如果頁面設定為 16:9 或 4:3 的「動態」外觀比例,您的內容就會調整成適合您所提供的 iFrame 大小。If you set your page to 'Dynamic' ratios like 16:9 or 4:3 your content will scale to fit within the iFrame, you provided. 當內嵌在 iFrame 中時,使用 [符合一頁大小] 會造成上下黑邊,當內容調整成符合 iFrame 後,iFrame 區域會出現灰色背景。When embedded in an iFrame, using Fit to page can result in letterboxing, where a gray background is shown in areas of the iFrame after the content as scaled to fit within the iFrame. 若要將上下黑邊縮到最小,請正確設定 iFrame 的高度/寬度。To minimize letterboxing, set your iFrame height/width appropriately.
PtW6d [實際大小] 可確保報表維持您在報表頁面上設定的大小。Actual size will ensure the report preserves its size as set on the report page. 這會導致 iFrame 中出現捲軸。This can result in scrollbars being present in your iFrame. 設定 iFrame 的高度和寬度以避免出現捲軸。Set the iFrame height and width to avoid the scrollbars.
PtW6c [符合寬度] 可確保內容符合您 iFrame 的水平寬度。Fit to width ensures the content fits within the horizontal area for your iFrame. 框線仍將顯示,但是內容大小會調整為使用所有的水平空間。A border will still be shown, but the content will scale to use all the horizontal space available.

iFrame 高度和寬度的秘訣和訣竅Tips and tricks for iFrame height and width

發佈至網路後,您會收到如下所示的內嵌程式碼:The embed code you receive after you Publish to web will look like the following:


您噁以手動編輯寬度與高度以確保它的大小適合您正在內嵌它的頁面。You can edit the width and height manually to ensure it's precisely how you want it to fit onto the page into which you're embedding it.

為使調整更臻理想,您可以嘗試在 iFrame 的高度加上 56 像素。To achieve a more perfect fit, you can try adding 56 pixels to the height dimension of the iFrame. 這可適應底端列的目前大小。This accommodates the current size of the bottom bar. 如果報表頁面使用動態大小,下表提供一些您可以使用而不會出現上下黑邊的大小。If your report page uses the Dynamic size, the table below provides some sizes you can use to achieve a fit without letterboxing.

外觀比例Ratio 大小Size 尺寸 (寬度 x 高度)Dimension (Width x Height)
16:916:9 Small 640 x 416 像素640 x 416 px
16:916:9 Medium 800 x 506 像素800 x 506 px
16:916:9 Large 960 x 596 像素960 x 596 px
4:34:3 Small 640 x 536 像素640 x 536 px
4:34:3 Medium 800 x 656 像素800 x 656 px
4:34:3 Large 960 x 776 像素960 x 776 px

管理內嵌程式碼Managing embed codes

建立 [ 發佈至網路 ] 內嵌程式碼後,您可以從 Power BI 服務的 [ 設定 ] 功能表上管理建立的程式碼。Once you create a Publish to web embed code, you can manage the codes you create from the Settings menu of the Power BI service. 管理內嵌程式碼時,可以移除目標視覺效果、回報程式碼 (會導致內嵌程式碼無法使用) 或重新取得內嵌程式碼。Managing embed codes includes the ability to remove the destination visual or report for a code (rendering the embed code unusable), or getting the embed code again.

  1. 若要管理您的 [發行到 Web] 內嵌程式碼,請開啟 [設定] 齒輪,然後選取 [管理內嵌程式碼] 。To manage your Publish to web embed codes, open the Settings gear and select Manage embed codes.


  2. 顯示已建立的內嵌程式碼清單,如下圖所示。The list of embed codes you’ve created appears, as shown in the following image.


  3. 針對清單上的每個 [ 發佈至網路 ] 內嵌程式碼,您可以擷取內嵌程式碼,或刪除內嵌程式碼以取消與該報表或視覺效果的所有連結。For each Publish to web embed code in the list, you can either retrieve the embed code, or delete the embed code and thus make any links to that report or visual no longer work.


  4. 如果您選取 [刪除],系統會詢問您是否確定刪除內嵌程式碼。If you select Delete, you’re asked if you’re sure you want to delete the embed code.


報表更新和資料重新整理Updates to reports, and data refresh

建立和共用 [ 發佈至網路 ] 內嵌程式碼後,報表將依據您的變更更新。After you create your Publish to web embed code and share it, the report is updated with any changes you make. 不過請務必注意,使用者可能需要一段時間才能看到更新。However, it’s important to know that it can take a while for update to be visible to your users. 報表或視覺效果更新需要大約一小時才會反映在 [發佈至網路] 內嵌程式碼上。Updates to a report or visual take approximately one hour to be reflected in Publish to web embed codes.

剛開始使用 [ 發佈至網路 ] 取得內嵌程式碼時,內嵌程式碼連結會立即啟用,開啟連結的人都可以檢視內容。When you initially use Publish to web to get an embed code, the embed code link is immediately active and can be viewed by anyone who opens the link. 第一次進行 [發佈至網路] 之後,接下來針對 [發佈至網路] 連結的報表或視覺效果進行更新,大約需要一小時使用者才能看到這些項目。After the initial Publish to web action, subsequent updates to reports or visuals to which a Publish to web link points can take approximately one hour to be visible to your users.

若要深入了解,請參閱本文稍後的< 運作方式 >一節。To learn more, see the How it works section later in this article. 如果需要立即可用的更新,您可以刪除內嵌程式碼,並建立新的內嵌程式碼。If you need your updates to be immediately available, you can delete the embed code and create a new one.

資料重新整理Data refresh

資料重新整理會自動反映在您的內嵌報表或視覺效果中。Data refreshes are automatically reflected in your embedded report or visual. 大約需要 1 小時,重新整理的資料才會顯示在內嵌程式碼中。It can take approximately 1 hour for refreshed data to be visible from embed codes. 您可以在報表使用的資料集排程上選取 [不重新整理],停用自動重新整理。You can disable automatic refresh by selecting don't refresh on the schedule for the dataset used by the report.

自訂視覺效果Custom visuals

[ 發佈至網路] 支援自訂視覺效果。Custom visuals are supported in Publish to web. 使用 [發佈至網路] 時,與您共用已發佈視覺效果的使用者不需要啟用自訂視覺效果,即可檢視報表。When you use Publish to web, users with whom you share your published visual do not need to enable custom visuals to view the report.


[發行至 Web] 支援絕大部分的資料來源和 Power BI 服務中的報表,但 [發行至 Web] 目前不支援或提供下列報表:Publish to web is supported for the vast majority of data sources and reports in the Power BI service, however, the following are not currently supported or available with Publish to web:

  • 使用資料列層級安全性的報表。Reports using row level security.
  • 使用任何即時連線資料來源的報表,包括裝載於內部部署 的 Analysis Services 表格式、Analysis Service 多維度和 Azure Analysis Services。Reports using any Live Connection data source, including Analysis Services Tabular hosted on-premises, Analysis Services Multidimensional, and Azure Analysis Services.
  • 直接或透過組織內容套件與您共用的報表。Reports shared to you directly or through an organizational content pack.
  • 位在您非屬編輯成員之群組中的報表。Reports in a group in which you are not an edit member.
  • [發行至 Web] 報表目前不支援 "R" 視覺效果。"R" Visuals are not currently supported in Publish to web reports.
  • 從已發行至 Web 之報表中的視覺效果匯出資料Exporting Data from visuals in a report, which has been published to the web
  • ArcGIS Maps for Power BI 視覺效果ArcGIS Maps for Power BI visuals
  • 報表包含報表層級 DAX 量值Reports containing report-level DAX measures
  • 單一登入資料查詢模型Single sign-on data query models
  • 安全的機密或專屬資訊Secure confidential or proprietary information
  • 隨著 [內嵌] 選項提供的自動驗證功能無法搭配 Power BI JavaScript API 使用。The automatic authentication capability provided with the Embed option doesn't work with the Power BI JavaScript API. 針對 Power BI JavaScript API,請使用使用者擁有資料方式來內嵌。For the Power BI JavaScript API, use the user owns data approach to embedding. 深入了解使用者擁有資料Learn more about user owns data.

租用戶設定Tenant setting

Power BI 系統管理員可以啟用或停用發佈到 web 功能。Power BI administrators can enable or disable the publish to web feature. 他們也可能會限制特定群組的存取。They may also restrict access to specific groups. 您以此設定作為基礎建立內嵌程式碼變更的能力。Your ability to create an embed code changes based on this setting.

功能Feature 允許整個組織使用Enabled for entire organization 不允許整個組織使用Disabled for entire organization 特定安全性群組Specific security groups
報告 [檔案] 功能表下的 [發佈至 web]。Publish to web under report's File menu. 針對全部啟用Enabled for all 並非所有人都可看到Not visible for all 只有經授權的使用者或群組才可看到。Only visible for authorized users or groups.
[設定] 下的 [管理內嵌程式碼]Manage embed codes under Settings 針對全部啟用Enabled for all 針對全部啟用Enabled for all 針對全部啟用Enabled for all

[刪除]* 選項僅適用於經授權的使用者或群組。* Delete option only for authorized users or groups.
針對全部啟用 [取得驗證碼]* 。* Get codes enabled for all.
系統管理員入口網站內的 [內嵌程式碼]Embed codes within admin portal 狀態會反映下列其中一項:Status will reflect one of the following:
* 使用中* Active
* 不支援* Not supported
* 已封鎖* Blocked
狀態會顯示 [已停用]Status will display Disabled 狀態會反映下列其中一項:Status will reflect one of the following:
* 使用中* Active
* 不支援* Not supported
* 已封鎖* Blocked

如果使用者未以租用戶設定作為基礎加以授權,狀態會顯示成 [侵害]。If a user is not authorized based on the tenant setting, status will display as infringed.
現有的已發佈報告Existing published reports 全部已啟用All enabled 全部已停用All disabled 報告會繼續針對全部項目呈現。Reports continue to render for all.

了解內嵌程式碼狀態欄Understanding the embed code status column

檢視 [ 發佈至網路 ] 內嵌程式碼的 [ 管理內嵌代碼 ] 頁面時,會看到一個狀態欄。When viewing the Manage embed codes page for your Publish to web embed codes, a status column is provided. 根據預設,內嵌程式碼的狀態為使用中,但您也可能遇到下列任何狀態。Embed codes are active by default, but you may encounter any of the states listed below.

狀態Status 描述Description
使用中Active 網際網路使用者可以檢視報表並與其互動。The report is available for Internet users to view and interact with.
封鎖Blocked 報表內容違反 Power BI 服務條款The content of the report violates the Power BI Terms of Service. 已遭 Microsoft 封鎖。It has been blocked by Microsoft. 如果您認為內容遭到不當封鎖,請連絡支援人員。Contact support if you believe the content was blocked in error.
不支援Not supported 報表的資料集使用資料列層級安全性或其他不受支援的設定。The report's data set is using row level security, or another unsupported configuration. 如需完整清單,請參閱限制一節。See the Limitations section for a complete list.
[侵害]Infringed 內嵌程式碼不屬於定義的租用戶原則。The embed code is outside of the defined tenant policy. 當內嵌程式碼建立,然後 [發佈到 web 租用戶] 設定變更為排除擁有內嵌程式的碼使用者時,通常就會發生這個情況。This typically occurs when an embed code was created and then the publish to web tenant setting was changed to exclude the user that owns the embed code. 如果已停用租用戶設定,或不再允許使用者建立內嵌程式碼,現有的內嵌程式碼就會顯示 [侵害] 的狀態。If the tenant setting is disabled, or the user is no longer allowed to create embed codes, existing embed codes will show the status of Infringed.

如何回報 [發佈至網路] 內容的相關問題How to report a concern with Publish to web content

若要回報內嵌在網站或部落格的 [ 發佈至網路 ] 內容之相關問題,請使用下方列的 旗標 圖示,如下圖所示。To report a concern related to Publish to web content embedded in a website or blog, use the Flag icon in the bottom bar, shown in the following image. 系統會請您傳送電子郵件給 Microsoft 來說明問題。You’ll be asked to send an email to Microsoft explaining the concern. Microsoft 會根據「Power BI 服務條款」來評估內容,並採取適當行動。Microsoft will evaluate the content based on the Power BI Terms of Service, and take appropriate action.

若要回報問題,請選取您可以在 [發佈至網路] 報表下方列上看到的 旗標 圖示。To report a concern, select the flag icon in the bottom bar of the Publish to web report you see.


授權和定價Licensing and Pricing

您必須是 Microsoft Power BI 使用者才能使用 [ 發佈至網路]。You need to be a Microsoft Power BI user to use Publish to web. 報表取用者 (讀者、檢閱者) 不需要是 Power BI 使用者。The consumers of your report (the readers, viewers) do not need to be Power BI users.

運作方式 (技術性詳細資料)How it works (technical details)

使用 [ 發佈至網路] 建立內嵌程式碼後,任何網路使用者皆可以檢視報表。When you create an embed code using Publish to web, the report is made visible to users on the Internet. 報表可以公開取得,因此,您可以預期檢閱者日後透過社交媒體輕鬆共用報表。It’s publicly available so you can expect viewers to easily share the report through social media in the future. 使用者直接開啟公用 URL 或在內嵌的網頁或部落格中檢視報表時,Power BI 會快取報表定義和檢視報表所需的查詢結果。As users view the report, either by opening the direct public URL or viewing it embedded in a web page or blog, Power BI caches the report definition and the results of the queries required to view the report. 這確保數千名並行使用者可以同時檢視報表,而不會影響效能。This approach ensures the report can be viewed by thousands of concurrent users without any impact on performance.

系統會長時間保留快取,所以如果您更新報表定義 (例如變更檢視模式),或重新整理報表資料,系統需要大約一小時,才會在使用者檢視的報表上反映變更。The cache is long-lived, so if you update the report definition (for example, if you change its View mode) or refresh the report data, it can take approximately one hour before changes are reflected in the version of the report viewed by your users. 因此建議您預先準備要進行的工作,並且只在對設定滿意後再建立 [ 發佈至網路 ] 內嵌程式碼。It is therefore recommended that you stage your work ahead of time, and create the Publish to web embed code only when you’re satisfied with the settings.

後續步驟Next steps

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