更改报表页的大小(教程)Change the size of a report page (Tutorial)

上一篇文章和视频中,你学习了在 Power BI 报表中控制页面显示的两种方法:“视图”和“页面大小”。In the previous article and video you learned about two different ways to control page display in Power BI reports: View and Page Size. 现在让我们亲自试试。Now let's try it ourselves.

首先,让我们更改页面的“视图”设置First, let's change the page View setting

  1. 在“阅读视图”或“编辑视图”中打开报表。Open a report in Reading View or Editing View. 此示例使用零售分析示例的“新建存储”页。This example uses the "New Stores" page of the Retail Analysis sample. 使用“调整到页面大小”设置显示此页面。This page is displayed using the Fit to Page setting. 在这种情况下,“适应页面”将显示不带滚动条的报表,但是其中的一些详细信息和标题因太小而无法阅读。In this case, Fit to Page displays the report page without scrollbars, but some of the detail and titles are too small to read.

  2. 请确保在画布上未选择可视化效果。Make sure that no visualizations are selected on the canvas. 选择“视图”并查看显示选项。Select View and review the display options.
  • 在“阅读”视图中,你可以看到此项。In Reading view you'll see this.

  • 在“编辑”视图中,你可以看到此项。In Editing view you'll see this.

  1. 让我们看看使用“实际大小”设置后页面看起来怎么样。Let's see how the page looks using the Actual size setting.

    不好,仪表板现有两个滚动条。Not great, the dashboard now has double scrollbars.

  2. 切换到“适应宽度”。Switch to Fit to Width.

    看起来好一些了,虽然仍有滚动条,但是可以更轻松地阅读详细信息。Looks better, we now have scrollbars but it's easier to read the detail.

更改报表页的默认视图Change the default view for a report page

所有 Power BI 报表默认使用“适应页面”视图。All Power BI reports default to Fit to page view. 但如果希望此报表页始终以“实际大小”视图打开,应该怎么做?But what if you want this report page to always open in Actual size view?

  1. 在报表的“新店铺”页上,切换回“实际大小”视图。On the New stores page of the report, switch back to Actual size view.

  2. 选择“文件”>“另存为”将报表保存为其他名称。Save the report with a different name by selecting File > Save as. 现有该报表的两个副本;在原始报表中,“新店铺”将继续以默认视图打开;但在新报表中,它将以“实际大小”视图打开。You now have 2 copies of this report; in the original report, New stores will continue to open in the default view but in the new report it will open in Actual size view. 请看演示。Let's go see.

  3. 从顶部导航栏中选择当前工作区的名称,以返回到该工作区。Select the name of the current workspace from the top navbar to return to that workspace.

  4. 选择“报表”选项卡,然后选择刚刚创建的新报表(它带有一个黄色的星号)。Select the Reports tab and choose the new report you just created (it will have a yellow asterisk).

  5. 报表以“实际大小”视图打开!The report opens in Actual size view!

现在,让我们浏览页面大小设置Now, let's explore the page size setting

只有编辑视图才提供“页面大小”设置。The page size settings are only available in Editing view. 若要在“编辑视图”中打开报表,必须具有该报表的所有者权限。To open a report in Editing view you must have owner permissions for the report. 如果你已连接到我们的任意示例,则拥有这些报表的所有者权限。If you've connected to any of our samples, you'll have owner permissions to those reports.

  1. 在“编辑视图”中打开零售分析示例的“地区每月销售额”页。Open the "District monthly sales" page of the Retail Analysis sample in Editing View.
  2. 请确保在画布上未选择可视化效果。Make sure that no visualizations are selected on the canvas. 在“可视化效果”窗格中,选择滚动油漆刷图标 In the Visualizations pane, select the paint roller icon .
  3. 选择“页面大小”>“类型”,以显示页面大小选项。Select Page size > Type to display the page size options.

  4. 选择“字母”。Select Letter. 在画布上,只有适应 816 x 1056 像素(字母大小)以内的内容才可以保留在画布的空白区域。On the canvas, only the contents that fit within 816 x 1056 pixels (Letter size) remain on the white portion of the canvas.

  5. 如果我们将“视图”更改为“适应宽度”,我们的画布将仅显示适应字母大小的页面内容。If we change View to "Fit to Width," our canvas now displays only the page contents that fit into the letter size.

  6. 选择“页面大小”“16:9”。Select Page size 16:9 ratio.

    使用 16:9 的宽高比显示报表页。The report page displays using a ratio of 16 wide by 9 high. 若要查看使用的实际像素大小,请查看灰色的宽度和高度字段 (1280 x 720)。To see the actual pixel size being used, take a look at the greyed out Width and Height fields (1280x720). 报表画布周围有很多空白部分,这是因为我们之前将“视图”设置为“适应宽度”。There is a lot of empty space around the report canvas; this is because we previously set View to "Fit to width".

  7. 继续探讨“页面大小”选项。Continue exploring the Page Size options.

结合使用页面“视图”和“页面大小”Using page View and Page Size together

结合使用页面视图和页面大小创建报表,使其在嵌入另一应用程序时具有其最佳外观。Use page View and Page Size together to create a report that looks its best when embedded in another application.

在本练习中,你将创建一个报表页,它将显示于可容纳宽 500 像素、高 750 像素的应用程序中。In this exercise, you'll create a report page that will display in an application that has space for 500 pixels wide by 750 pixels high.

记得在上一步中,报表页当前显示为宽 1280 像素、高 720 像素。Remember in the previous step we saw that our report page is currently displaying at 1280 wide by 720 high. 因此我们知道,如果希望所有视觉对象都适应页面,需要进行大量的大小调整和重新排列。So we know that we'll need to do a lot of resizing and rearranging if we want all of our visuals to fit.

  1. 调整并移动视觉对象,使其可放入当前画布区域一半大小以下的空间。Resize and move the visuals so that they fit in less than half of the current canvas area.

  2. 选择“页面大小”>“自定义”。Select Page Size > Custom.
  3. 将宽度设置为 500,高度设置为 750。Set Width to 500 and set Height to 750.

  4. 调整报表页以使其达到最佳显示效果。Tweak the report page so that it looks its best. 在“视图”>“实际大小”和“视图”>“调整到页面大小”之间切换以便调整。Switch between View > Actual size and View > Fit to page to make adjustments.

后续步骤Next steps

为 Cortana 创建报表Create reports for Cortana

返回到 Power BI 报表中的页面显示设置Back to Page display settings in a Power BI report

详细了解 Power BI 中的报表Read more about reports in Power BI

更多问题?More questions? 尝试参与 Power BI 社区Try the Power BI Community