将 Power BI 项目报表嵌入 SharePoint OnlineEmbed the Power BI project report in SharePoint Online

注意:本文属于将 PowerApps、Microsoft Flow 和 Power BI 与 SharePoint Online 结合使用的系列教程。Note: This article is part of a tutorial series on using PowerApps, Microsoft Flow, and Power BI with SharePoint Online. 请确保已阅读系列介绍,了解总体情况以及相关下载内容。Make sure you read the series introduction to get a sense of the big picture, as well as related downloads.

此方案的最后一个任务是将 Power BI 报表嵌入托管我们两个列表的相同 SharePoint Online 网站。The last task in this scenario is to embed our Power BI report in the same SharePoint Online site that hosts our two lists. Power BI 支持多种嵌入方法,最近新增了可将 Web 和移动视图直接集成到 SharePoint 网页的功能。Power BI supports a variety of approaches to embedding, and has recently added integration directly into SharePoint pages for web and mobile views.

使用这种嵌入类型,Power BI 可以将报表作为 Web 部件嵌入,为用户提供适当的访问权限,并且你可以单击嵌入的报表转到 powerbi.com 上的报表。首先,我们将在 Power BI 中生成嵌入链接,然后在我们创建的网页中使用此链接。With this type of embedding, Power BI embeds the report as a web part, provides appropriate access for users, and lets you click through from the embedded report to the report at powerbi.com. First, we'll generate an embed link in Power BI, then use that link in a page that we create. 若要详细了解如何嵌入,请参阅使用报表 Web 部件在 SharePoint Online 中嵌入报表(尤其是“要求”部分)。For more information on embedding, see Embed with report web part in SharePoint Online (especially the Requirements section).

  1. 登录 Power BI,再单击或点击左侧导航窗格中的报表名称。Sign in to Power BI, then in the left navigation pane, click or tap the report name.

    转到报表

  2. 单击或点击“在 SharePoint Online 中嵌入”。Click or tap Embed in SharePoint Online.

    在 SharePoint Online 中嵌入

  3. 将对话框中的嵌入链接复制到文件中,再单击“关闭”。Copy the embed link from the dialog box to a file, then click Close. 我们将在创建 SharePoint 网页后使用此链接。We will use the link after we create a SharePoint page.

    适用于 SharePoint 的嵌入链接

第 2 步:嵌入报表Step 2: Embed the report

  1. 登录 SharePoint,再单击或点击“网站内容”。Sign in to SharePoint, then click or tap Site contents.

    SharePoint 网站内容

  2. 虽然可以直接在团队主页上嵌入报表,但我们也将介绍如何为报表创建单独的网页。You could just include a report on the team home page, but we'll show you how to create a separate page for it also. 依次单击或点击“新建”和“网页”。Click or tap New, then Page.

    新建 SharePoint 网页

  3. 输入网页名称(如“项目分析”)。Enter a name for the page, like "Project Analysis".
  4. 依次单击或点击 加号图标 和“Power BI”。Click or tap Plus icon then Power BI.

    添加 Power BI 网页部件

  5. 单击或点击“添加报表”。Click or tap Add report.

    添加报表

  6. 在右侧窗格中,将嵌入 URL 复制到“Power BI 报表链接”框中。In the right pane, copy the embed URL into the Power BI report link box. 将“显示筛选器窗格”和“显示导航窗格”都设置为“开”。Set both Show Filter Pane and Show Navigation Pane to On.

    报表设置

  7. 此时,报表已嵌入网页。The report is now embedded in the page. 单击“发布”,以供所有有权访问基础报表的人员访问。Click Publish to make it available to anyone who can access the underlying report.

    报表嵌入已完成

第 3 步:授予报表访问权限。Step 3: Grant access to the report.

如果根据我们的建议使用 Office 365 组,请确保需要获取访问权限的用户是 Power BI 服务内组工作区的成员。If you are using Office 365 Groups as we recommend, make sure users who need access are members of the group workspace within the Power BI service. 这样可确保用户能够查看相应组的内容。This ensures that users can view the contents of that group. 有关详细信息,请参阅在 Power BI 中创建组For more information, see Creating groups in Power BI.

此方案在 Power BI 中的操作部分到此结束。That wraps up our work in Power BI for this scenario. 我们先是将 SharePoint 列表中的数据提取到 Power BI 中,而现在整整转了一圈,又将 Power BI 报表重新嵌入 SharePoint 中。You started by pulling data from our SharePoint lists into Power BI, and have now come full circle to embedding your Power BI report back into SharePoint.

后续步骤Next steps

本系列教程的下一步是对我们已创建的工作流进行端到端演练The next step in this tutorial series is to run through the workflow we created end-to-end.