<?xml version="1.0" encoding="UTF-8"?>
<rss xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:rdf="http://www.w3.org/1999/02/22-rdf-syntax-ns#" xmlns:taxo="http://purl.org/rss/1.0/modules/taxonomy/" version="2.0">
  <channel>
    <title>topic Embedding App Owns Data PowerBI Report in Nuxt in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Embedding-App-Owns-Data-PowerBI-Report-in-Nuxt/m-p/4088384#M54656</link>
    <description>&lt;P&gt;Anyone have a Nuxt component for embedding a PowerBI report.&amp;nbsp; I've been using the&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;powerbi-client-vue-js library, but my report is not rendering consistently.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;This is my current version;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;script setup lang="ts"&amp;gt;
import { PowerBIReportEmbed } from "powerbi-client-vue-js";
import { models } from "powerbi-client";

const isLoaded = ref&amp;lt;boolean&amp;gt;(false);

const props = defineProps({
  reportId: {
    type: String,
    required: true,
  },
  workspaceId: {
    type: String,
    required: true,
  },
});
const { reportId, workspaceId } = props;

const { data } = await useFetch("/api/embedData", {
  cache: "no-cache",
  query: {
    reportId,
    workspaceId,
  },
});

const accessToken = data.value?.accessToken;
const embedUrl = data.value?.embedUrl;

const embedConfig = ref&amp;lt;models.IReportEmbedConfiguration&amp;gt;({
  type: "report",
  embedUrl: undefined,
  tokenType: models.TokenType.Embed,
  accessToken: undefined,
  settings: undefined,
});

const phasedEmbedding = false;
isLoaded.value = true;

embedConfig.value = {
  type: "report",
  id: reportId,
  embedUrl: embedUrl,
  accessToken: accessToken,
  tokenType: models.TokenType.Embed,
  permissions: models.Permissions.Read,
  settings: {
    panes: {
      filters: { expanded: false, visible: false },
      pageNavigation: { visible: false },
    },
    // background: models.BackgroundType.Transparent,
  },
};

const eventHandlers = new Map([
  ["loaded", () =&amp;gt; console.log("Report Loaded")],
  ["rendered", () =&amp;gt; console.log("Report Rendered")],
  ["error", (event: any) =&amp;gt; console.log(event.detail)],
]);
&amp;lt;/script&amp;gt;

&amp;lt;template&amp;gt;
  &amp;lt;div&amp;gt;
    &amp;lt;PowerBIReportEmbed
      v-if="isLoaded"
      :embedConfig="embedConfig"
      :eventHandlers="eventHandlers"
      cssClassName="report-container"
      :phasedEmbedding="phasedEmbedding"
    /&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;style scoped&amp;gt;
.report-container {
  height: 50vh;
  margin: 2rem auto;
  width: 1000px;
  border-width: 2pt;
  border-color: blue;
  border-radius: 3pt;
  box-shadow: 3px 3px 2px silver;
}
&amp;lt;/style&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
    <pubDate>Thu, 08 Aug 2024 05:55:11 GMT</pubDate>
    <dc:creator>bnln</dc:creator>
    <dc:date>2024-08-08T05:55:11Z</dc:date>
    <item>
      <title>Embedding App Owns Data PowerBI Report in Nuxt</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embedding-App-Owns-Data-PowerBI-Report-in-Nuxt/m-p/4088384#M54656</link>
      <description>&lt;P&gt;Anyone have a Nuxt component for embedding a PowerBI report.&amp;nbsp; I've been using the&amp;nbsp;&lt;/P&gt;&lt;DIV&gt;&lt;DIV&gt;&lt;SPAN&gt;powerbi-client-vue-js library, but my report is not rendering consistently.&lt;BR /&gt;&lt;BR /&gt;&lt;/SPAN&gt;&lt;SPAN&gt;&lt;SPAN&gt;This is my current version;&lt;BR /&gt;&lt;/SPAN&gt;&lt;/SPAN&gt;&lt;/DIV&gt;&lt;/DIV&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;LI-CODE lang="javascript"&gt;&amp;lt;script setup lang="ts"&amp;gt;
import { PowerBIReportEmbed } from "powerbi-client-vue-js";
import { models } from "powerbi-client";

const isLoaded = ref&amp;lt;boolean&amp;gt;(false);

const props = defineProps({
  reportId: {
    type: String,
    required: true,
  },
  workspaceId: {
    type: String,
    required: true,
  },
});
const { reportId, workspaceId } = props;

const { data } = await useFetch("/api/embedData", {
  cache: "no-cache",
  query: {
    reportId,
    workspaceId,
  },
});

const accessToken = data.value?.accessToken;
const embedUrl = data.value?.embedUrl;

const embedConfig = ref&amp;lt;models.IReportEmbedConfiguration&amp;gt;({
  type: "report",
  embedUrl: undefined,
  tokenType: models.TokenType.Embed,
  accessToken: undefined,
  settings: undefined,
});

const phasedEmbedding = false;
isLoaded.value = true;

embedConfig.value = {
  type: "report",
  id: reportId,
  embedUrl: embedUrl,
  accessToken: accessToken,
  tokenType: models.TokenType.Embed,
  permissions: models.Permissions.Read,
  settings: {
    panes: {
      filters: { expanded: false, visible: false },
      pageNavigation: { visible: false },
    },
    // background: models.BackgroundType.Transparent,
  },
};

const eventHandlers = new Map([
  ["loaded", () =&amp;gt; console.log("Report Loaded")],
  ["rendered", () =&amp;gt; console.log("Report Rendered")],
  ["error", (event: any) =&amp;gt; console.log(event.detail)],
]);
&amp;lt;/script&amp;gt;

&amp;lt;template&amp;gt;
  &amp;lt;div&amp;gt;
    &amp;lt;PowerBIReportEmbed
      v-if="isLoaded"
      :embedConfig="embedConfig"
      :eventHandlers="eventHandlers"
      cssClassName="report-container"
      :phasedEmbedding="phasedEmbedding"
    /&amp;gt;
  &amp;lt;/div&amp;gt;
&amp;lt;/template&amp;gt;

&amp;lt;style scoped&amp;gt;
.report-container {
  height: 50vh;
  margin: 2rem auto;
  width: 1000px;
  border-width: 2pt;
  border-color: blue;
  border-radius: 3pt;
  box-shadow: 3px 3px 2px silver;
}
&amp;lt;/style&amp;gt;&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 05:55:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embedding-App-Owns-Data-PowerBI-Report-in-Nuxt/m-p/4088384#M54656</guid>
      <dc:creator>bnln</dc:creator>
      <dc:date>2024-08-08T05:55:11Z</dc:date>
    </item>
    <item>
      <title>Re: Embedding App Owns Data PowerBI Report in Nuxt</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embedding-App-Owns-Data-PowerBI-Report-in-Nuxt/m-p/4090186#M54671</link>
      <description>&lt;P&gt;Thanks &lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="787007" data-lia-user-login="robert245" class="lia-mention lia-mention-user"&gt;robert245&lt;/a&gt; for taking the time to go over the component.&amp;nbsp; Your comments have been helpful, especially checking the fetch!&lt;/P&gt;</description>
      <pubDate>Thu, 08 Aug 2024 23:34:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embedding-App-Owns-Data-PowerBI-Report-in-Nuxt/m-p/4090186#M54671</guid>
      <dc:creator>bnln</dc:creator>
      <dc:date>2024-08-08T23:34:06Z</dc:date>
    </item>
    <item>
      <title>Re: Embedding App Owns Data PowerBI Report in Nuxt</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Embedding-App-Owns-Data-PowerBI-Report-in-Nuxt/m-p/4094615#M54706</link>
      <description>&lt;P&gt;Hi&amp;nbsp;&lt;a href="javascript:void(0)" data-lia-user-mentions="" data-lia-user-uid="781081" data-lia-user-login="bnln" class="lia-mention lia-mention-user"&gt;bnln&lt;/a&gt;&amp;nbsp;,&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;I suggest you to follow the steps of &lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-sample-for-customers?tabs=net-core" target="_self"&gt;this offical blog&lt;/A&gt; to configure app owns data in your application.&lt;/P&gt;
&lt;P&gt;If you use service principal as authentication method, please check the blog as below.&lt;/P&gt;
&lt;P&gt;For reference:&lt;BR /&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/embed-service-principal" target="_self"&gt;Embed Power BI content in an embedded analytics application with service principal and an application secret&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;Finally, you can download the sample from this link and check the&amp;nbsp;&lt;A href="https://github.com/microsoft/PowerBI-Developer-Samples" target="_self"&gt;Node JS sample&lt;/A&gt;&amp;nbsp;.&lt;/P&gt;
&lt;P&gt;&lt;img /&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Best Regards,&lt;BR /&gt;Rico Zhou&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 12 Aug 2024 06:29:02 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Embedding-App-Owns-Data-PowerBI-Report-in-Nuxt/m-p/4094615#M54706</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2024-08-12T06:29:02Z</dc:date>
    </item>
  </channel>
</rss>

