我是 Power BI Embedded 的新手,并且已经阅读了几个教程,但我能得到的只是将它嵌入 C# 的教程,但我是一名 php 开发人员,对 C# 一无所知。
我已经创建了我的 Power BI 报告并通过在我的 Azure 门户中注册新的 Power BI 来生成令牌。
我现在如何使用这些令牌?
我是 Power BI Embedded 的新手,并且已经阅读了几个教程,但我能得到的只是将它嵌入 C# 的教程,但我是一名 php 开发人员,对 C# 一无所知。
我已经创建了我的 Power BI 报告并通过在我的 Azure 门户中注册新的 Power BI 来生成令牌。
我现在如何使用这些令牌?
您需要采取一些步骤:
POST https://api.powerbi.com/v1.0/collections/mypbiapp/workspaces
Authorization: AppKey {yourAccessKey}
现在您应该有一个工作区 ID。
https://api.powerbi.com/v1.0/collections/{collectionName}/workspaces/{workspaceId}/imports?datasetDisplayName={somename}
现在你应该有一个报告ID。
var embedConfiguration = {
type: 'report',
accessToken: {your-jwt-token-string},
id: {your-report-id-string},
embedUrl: 'https://embedded.powerbi.com/appTokenReportEmbed'
};
var $reportContainer = $('#reportContainer'); //some div
var report = powerbi.embed($reportContainer.get(0), embedConfiguration);
现在您的应用程序中应该有一个报告。
您可以使用适用于许多用例的基本 iframe 解决方案。
以下是步骤: