嵌入的 Power BI 中的报表视觉对象和磁贴之间有什么区别?



我不清楚 Power bi 报表视觉对象和磁贴之间有什么区别? 报表视觉对象具有更多交互界面,而磁贴则没有。

它只是一个只读报表视觉对象吗?

此外,对于报表视觉对象,是否无法添加呈现报表时可用的上下文菜单?

谢谢 德里克

区别在于 Power BI 项目的来源和检索它所需的设置。

报表视觉对象 - 顾名思义,这是驻留在 Power BI 报表中的视觉对象。 要嵌入它,您需要使用:


// Embed configuration used to describe the what and how to embed.
// This object is used when calling powerbi.embed.
// This also includes settings and options such as filters.
// You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
var config= {
type: 'visual',
tokenType: models.TokenType.Embed,
accessToken: txtAccessToken,
embedUrl: embedUrl,
id: reportId,
pageName: pageName,
visualName: visualName
};

// Get a reference to the embedded report HTML element
var embedContainer = $('#visualContainer')[0];

// Embed the report and display it within the div container.
var report = powerbi.embed(embedContainer, config);
其中id是指ReportId,pageNamevisualName分别是指它所在的页面和视觉名称。

https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Single-Visual

磁贴 - 这是一个仪表板磁贴,本质上是固定到 Power BI 中的仪表板的视觉对象。

// Embed configuration used to describe the what and how to embed.
// This object is used when calling powerbi.embed.
// You can find more information at https://github.com/Microsoft/PowerBI-JavaScript/wiki/Embed-Configuration-Details.
var config= {
type: 'tile',
tokenType: models.TokenType.Embed,
accessToken: accessToken,
embedUrl: embedUrl,
id: embedTileId,
dashboardId: embedDashboardId
};
// Get a reference to the embedded tile HTML element
var tileContainer = $('#tileContainer')[0];
// Embed the tile and display it within the div container.
var tile = powerbi.embed(tileContainer, config);

其中id是磁贴 ID (GUID),dashboardId是它所在的仪表板。

编辑

另一个区别是,报表视觉对象支持报表嵌入中可用的所有功能,例如书签、导出数据、自定义布局、菜单扩展。而磁贴仅支持目前仅限于各种事件的仪表板交互,主要事件是"磁贴单击"事件

最新更新