<?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 Re: Export Report with ExportToFileInGroupAsync and Bookmarks using State from Frontend in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Export-Report-with-ExportToFileInGroupAsync-and-Bookmarks-using/m-p/2857206#M39387</link>
    <description>&lt;P&gt;you can practice your call (and validate the format) here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/reports/export-to-file-in-group" target="_blank" rel="noopener"&gt;Reports - Export To File In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read about the limitations here&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/export-to#considerations-and-limitations" target="_blank" rel="noopener"&gt;Export Power BI embedded analytics reports API - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(note the limitation on personal bookmarks)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE:&amp;nbsp; The bookmark name may not be what you think it is.&amp;nbsp; Retrieve the bookmarknames to see what the format is.&amp;nbsp; &amp;nbsp; Should be bookmark&amp;lt;guid&amp;gt;&lt;/P&gt;</description>
    <pubDate>Sun, 23 Oct 2022 01:20:28 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2022-10-23T01:20:28Z</dc:date>
    <item>
      <title>Export Report with ExportToFileInGroupAsync and Bookmarks using State from Frontend</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Export-Report-with-ExportToFileInGroupAsync-and-Bookmarks-using/m-p/2855144#M39371</link>
      <description>&lt;P&gt;I am trying to apply a bookmark while exporting the report. I have an angular front end and I am using the power-bi-client module to capture the bookmark from the report:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;PRE&gt;var bookmark= await embed.bookmarksManager.capture();&lt;BR /&gt;var state= bookmark.state&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;Then i pass the state to .NET backend to create a bookmark with the state:&lt;/P&gt;&lt;PRE&gt;PageBookmark bookmark = new PageBookmark(state:state);&lt;/PRE&gt;&lt;P&gt;&amp;nbsp;And finally to call&amp;nbsp;ExportToFileInGroupAsync with the info:&lt;/P&gt;&lt;PRE&gt;public static async Task&amp;lt;string&amp;gt; PostExportRequest(&lt;BR /&gt;string id_execution,&lt;BR /&gt;PageBookmark bookmark,&lt;BR /&gt;string dataset_id,&lt;BR /&gt;Guid reportId,&lt;BR /&gt;Guid groupId,&lt;BR /&gt;FileFormat format,&lt;BR /&gt;PowerBIClient Client,&lt;BR /&gt;IList&amp;lt;string&amp;gt; pageNames = null, /* Get the page names from the GetPages REST API */&lt;BR /&gt;string urlFilter = null)&lt;BR /&gt;{&lt;BR /&gt;    var powerBIReportExportConfiguration = new PowerBIReportExportConfiguration&lt;BR /&gt;    {&lt;BR /&gt;    Settings = new ExportReportSettings&lt;BR /&gt;        {&lt;BR /&gt;        Locale = "en-us",&lt;BR /&gt;        },&lt;BR /&gt;    DefaultBookmark = bookmark, &lt;FONT color="#FF6600"&gt;/////////////HERE&lt;/FONT&gt;&lt;BR /&gt;    Pages = pageNames?.Select(pn =&amp;gt; new ExportReportPage(pn)).ToList(),&lt;BR /&gt;    Identities = new List&amp;lt;EffectiveIdentity&amp;gt;() {new EffectiveIdentity()&lt;BR /&gt;        {&lt;BR /&gt;        Roles = new List&amp;lt;string&amp;gt;() { "role1" },&lt;BR /&gt;        Username = id_execution,&lt;BR /&gt;        Datasets = new List&amp;lt;string&amp;gt;() { dataset_id }&lt;BR /&gt;        }&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;    };&lt;BR /&gt;&lt;BR /&gt;    var exportRequest = new ExportReportRequest&lt;BR /&gt;    {&lt;BR /&gt;    Format = format,&lt;BR /&gt;    PowerBIReportConfiguration = powerBIReportExportConfiguration,&lt;BR /&gt;    };&lt;BR /&gt;    try&lt;BR /&gt;    {&lt;BR /&gt;    var export = await Client.Reports.ExportToFileInGroupAsync(groupId, reportId, exportRequest);&lt;BR /&gt;    return export.Id;&lt;BR /&gt;    }&lt;BR /&gt;    catch (Exception e)&lt;BR /&gt;    {&lt;BR /&gt;    return e.Message;&lt;BR /&gt;    }&lt;BR /&gt;&lt;BR /&gt;}&lt;/PRE&gt;&lt;P&gt;The call works without the bookmark, but it returns a generic BadRequest with it.&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;How am I supposed to pass the bookmark?&lt;/P&gt;</description>
      <pubDate>Fri, 21 Oct 2022 07:21:06 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Export-Report-with-ExportToFileInGroupAsync-and-Bookmarks-using/m-p/2855144#M39371</guid>
      <dc:creator>GianmarcoItaca</dc:creator>
      <dc:date>2022-10-21T07:21:06Z</dc:date>
    </item>
    <item>
      <title>Re: Export Report with ExportToFileInGroupAsync and Bookmarks using State from Frontend</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Export-Report-with-ExportToFileInGroupAsync-and-Bookmarks-using/m-p/2857206#M39387</link>
      <description>&lt;P&gt;you can practice your call (and validate the format) here&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/rest/api/power-bi/reports/export-to-file-in-group" target="_blank" rel="noopener"&gt;Reports - Export To File In Group - REST API (Power BI Power BI REST APIs) | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;Read about the limitations here&lt;/P&gt;
&lt;P&gt;&lt;A href="https://learn.microsoft.com/en-us/power-bi/developer/embedded/export-to#considerations-and-limitations" target="_blank" rel="noopener"&gt;Export Power BI embedded analytics reports API - Power BI | Microsoft Learn&lt;/A&gt;&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;(note the limitation on personal bookmarks)&lt;/P&gt;
&lt;P&gt;&amp;nbsp;&lt;/P&gt;
&lt;P&gt;NOTE:&amp;nbsp; The bookmark name may not be what you think it is.&amp;nbsp; Retrieve the bookmarknames to see what the format is.&amp;nbsp; &amp;nbsp; Should be bookmark&amp;lt;guid&amp;gt;&lt;/P&gt;</description>
      <pubDate>Sun, 23 Oct 2022 01:20:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Export-Report-with-ExportToFileInGroupAsync-and-Bookmarks-using/m-p/2857206#M39387</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2022-10-23T01:20:28Z</dc:date>
    </item>
  </channel>
</rss>

