You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

能否将Power BI服务导航栏的导出下拉按钮添加到嵌入报表中?

Power BI嵌入报表无PPU许可实现PDF/PPT导出方案

你之前查阅的服务端导出API确实需要PPU或Premium容量许可,你可以选择客户端侧导出方案,仅要求访问用户持有Power BI Pro许可即可满足需求,具体实现方式如下:

方案1:使用Power BI嵌入API配置默认导出按钮

  • 初始化报表嵌入参数时,通过settings配置隐藏所有无关导航组件,仅保留导出功能:
const embedConfig = {
  type: 'report',
  id: '你的报表唯一ID',
  embedUrl: '你的报表嵌入地址',
  accessToken: '当前用户的访问令牌',
  settings: {
    // 隐藏所有无关面板
    panes: {
      filters: { visible: false },
      pageNavigation: { visible: false }
    },
    navContentPaneEnabled: false,
    appBar: { visible: false },
    // 仅启用导出功能
    export: {
      enabled: true,
      exportToPdfEnabled: true,
      exportToPptEnabled: true
    }
  }
};
// 执行报表嵌入
const report = powerbi.embed(document.getElementById('report-container'), embedConfig);

方案2:完全自定义导出按钮(无多余默认按钮)

如果不需要Power BI默认的任何工具栏组件,可以自己在网页中添加导出按钮,直接调用客户端导出API实现功能,页面无任何多余元素:

  1. 页面中添加自定义按钮的HTML示例:
<button id="export-pdf-btn">导出PDF</button>
<button id="export-ppt-btn">导出PPT</button>
<div id="report-container"></div>
  1. 绑定按钮点击事件调用导出方法:
// 导出PDF
document.getElementById('export-pdf-btn').addEventListener('click', async () => {
  const pdfConfig = {
    format: powerbi.models.ExportFileType.PDF,
    // 可自定义导出的页面范围、导出设置等
    pages: (await report.getPages()).map(page => page.name)
  };
  await report.exportToFile(pdfConfig);
});

// 导出PPT
document.getElementById('export-ppt-btn').addEventListener('click', async () => {
  const pptConfig = {
    format: powerbi.models.ExportFileType.PPTX
  };
  await report.exportToFile(pptConfig);
});

许可说明

以上两种方案均属于客户端侧导出,仅要求访问嵌入报表的用户持有Power BI Pro许可即可,不存在PPU许可限制,完全适配企业内部嵌入场景。

内容的提问来源于stack exchange,提问作者Divyansh Vaidya

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.09.29 00:54:08