OiO.lk Community platform!

Oio.lk is an excellent forum for developers, providing a wide range of resources, discussions, and support for those in the developer community. Join oio.lk today to connect with like-minded professionals, share insights, and stay updated on the latest trends and technologies in the development field.
  You need to log in or register to access the solved answers to this problem.
  • You have reached the maximum number of guest views allowed
  • Please register below to remove this limitation

Error binding a dataset dynamically to a PowerBI embedded report

  • Thread starter Thread starter Andrés Meza-Escallón
  • Start date Start date
A

Andrés Meza-Escallón

Guest
I have a PowerBI embedded report in my web application. The data for each of my customers is stored in their own dataset (semantic model). Instead of creating a pair of report-dataset for each customer, I would like to have one single report and to dynamically select to with dataset connect in order to load the data.

According to this article it is possible to connect a report to multiple datasets dynamically.

So, I published my "report" and its "dataset" to a premium Workspace in powerbi-online. I tested the embedding and it works perfectly. Then I made a copy of the report and published to the same Workspace, so now I have "report", "dataset", "report (test2)", "dataset (test2)". Note that "dataset" and "dataset (test2)" are identical except for their name. And since all components ("report", "dataset" and "dataset (test2)") are in the same Workspace, they all share the same permissions (right?).

So, following the example in the article I implemented the javascript like this:

Code:
var reportLoadConfig = {
       type: "report",        
       tokenType: models.TokenType.Embed,
       filters: [filter_user],
       datasetBinding: {
           sourceDatasetId: "67e095eb-0570-444f-a2c5-0c7b68f9ff85", # dataset
           targetDatasetId: "7a274ca6-7ed0-4bd1-a832-f9732f96164a"  # dataset (test2)
       }
   };
 
   $.ajax({
       type: "GET",
       url: "/getembedinfo_filtered?report=06212621-c8cc-4153-a001-09c98ff2ceb4",
       dataType: "json",
       success: function (data) {
           var embedData = $.parseJSON(data);
           reportLoadConfig.accessToken = embedData.accessToken;
           reportLoadConfig["settings"] = {
               filterPaneEnabled: false,
               navContentPaneEnabled: true
           };
 
           // Embed Power BI report when Access token and Embed URL are available
           var report = powerbi.embed(reportContainer, reportLoadConfig);

But I get an error "This content isn't available."

Embedding Error: {message: 'LoadReportFailed', detailedMessage: 'Get report failed', errorCode: '403', level: 6, technicalDetails: {…}}

<p>I have a PowerBI embedded report in my web application. The data for each of my customers is stored in their own dataset (semantic model). Instead of creating a pair of report-dataset for each customer, I would like to have one single report and to dynamically select to with dataset connect in order to load the data.</p>
<p>According to <a href="https://learn.microsoft.com/en-us/javascript/api/overview/powerbi/bind-report-datasets" rel="nofollow noreferrer">this article</a> it is possible to connect a report to multiple datasets dynamically.</p>
<p>So, I published my "report" and its "dataset" to a premium Workspace in powerbi-online. I tested the embedding and it works perfectly. Then I made a copy of the report and published to the same Workspace, so now I have "report", "dataset", "report (test2)", "dataset (test2)". Note that "dataset" and "dataset (test2)" are identical except for their name. And since all components ("report", "dataset" and "dataset (test2)") are in the same Workspace, they all share the same permissions (right?).</p>
<p>So, following the example in the article I implemented the javascript like this:</p>
<pre class="lang-js prettyprint-override"><code>var reportLoadConfig = {
type: "report",
tokenType: models.TokenType.Embed,
filters: [filter_user],
datasetBinding: {
sourceDatasetId: "67e095eb-0570-444f-a2c5-0c7b68f9ff85", # dataset
targetDatasetId: "7a274ca6-7ed0-4bd1-a832-f9732f96164a" # dataset (test2)
}
};

$.ajax({
type: "GET",
url: "/getembedinfo_filtered?report=06212621-c8cc-4153-a001-09c98ff2ceb4",
dataType: "json",
success: function (data) {
var embedData = $.parseJSON(data);
reportLoadConfig.accessToken = embedData.accessToken;
reportLoadConfig["settings"] = {
filterPaneEnabled: false,
navContentPaneEnabled: true
};

// Embed Power BI report when Access token and Embed URL are available
var report = powerbi.embed(reportContainer, reportLoadConfig);

</code></pre>
<p>But I get an error "This content isn't available."</p>
<p>Embedding Error: {message: 'LoadReportFailed', detailedMessage: 'Get report failed', errorCode: '403', level: 6, technicalDetails: {…}}</p>
 

Latest posts

Top