Je souhaite intégrer mon tableau de bord PowerBi dans un fichier HTML en utilisant JavaScript à partir de l'exemple de code this GitHub. L'erreur que je reçois est:Tableau de bord JavaScript PowerBi embedConfiguration
Impossible d'obtenir la propriété des « modèles » de référence non définie ou null
Suis-je manque un fichier .js
qui doit être ajouté à la section de tête?
<!DOCTYPE html>
<html>
<head>
<meta charset="utf-8" />
<title></title>
<script src="http://ajax.aspnetcdn.com/ajax/jquery/jquery-1.7.js"></script>
<script src="http://ajax.aspnetcdn.com/ajax/jquery.ui/1.8.10/jquery-ui.js"></script>`
<script>
$(document).ready(function() {
// Get models. models contains enums that can be used.
var models = window['powerbi-client'].models;
var embedConfiguration = {
type: 'dashboard',
id: 'dashboardid',
embedUrl: 'https://app.powerbi.com/reportEmbed',
tokenType: models.TokenType.Aad,
accessToken: 'TokenKey'
};
var $dashboardContainer = $('#embedContainer');
var dashboard = powerbi.embed($dashboardContainer.get(0), embedConfiguration);
});
</script>
</head >
<body>
<div id="dashboardContainer"></div>
</body >
</html >
Avez-vous essayé d'inclure la bibliothèque de PowerBi? Après cela, je pense que vous pourriez avoir besoin de d3. aussi – Alberto