<?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: Power BI Export to file Error in Developer</title>
    <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173987#M24321</link>
    <description>&lt;P&gt;That would make too much sense.&amp;nbsp; So better test with specifying the pages , just in case...&lt;/P&gt;</description>
    <pubDate>Mon, 22 Jun 2020 16:20:46 GMT</pubDate>
    <dc:creator>lbendlin</dc:creator>
    <dc:date>2020-06-22T16:20:46Z</dc:date>
    <item>
      <title>Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1169886#M24284</link>
      <description>&lt;P&gt;&lt;SPAN&gt;We are using the latest version of the API (V3)&lt;/SPAN&gt;&lt;BR /&gt;&lt;SPAN&gt;I have copied the code examples from here -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to&lt;/A&gt;&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;in my '&lt;/SPAN&gt;PostExportRequest'&lt;SPAN&gt;&amp;nbsp;function I have tried the following -&amp;nbsp;&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var Client = GetPowerBiClient();
var export = Client.Reports.ExportToFileAsync(reportId, exportRequest); 
export.Wait(); 
var exportResult = export.Result;&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;On the wait, I get a 'Forbidden' error&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;The&amp;nbsp;user accessing this is acting as a&amp;nbsp;Service Principal and is set to have full admin rights on the PowerBI settings.&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;on this -&lt;/SPAN&gt;&lt;/P&gt;&lt;LI-CODE lang="csharp"&gt;var Client = GetPowerBiClient(); var export = Await Client.Reports.ExportToFileAsync(reportId, exportRequest);&lt;/LI-CODE&gt;&lt;P&gt;&lt;BR /&gt;&lt;SPAN&gt;This never completes and seems to run forever.&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Thu, 18 Jun 2020 20:58:19 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1169886#M24284</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-18T20:58:19Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1171803#M24299</link>
      <description>&lt;P&gt;Aren't you supposed to check periodically for the rendering process to complete? It's asynchronous, so Wait() seems to be counter intuitive.&lt;/P&gt;</description>
      <pubDate>Sat, 20 Jun 2020 01:08:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1171803#M24299</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-20T01:08:28Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173560#M24310</link>
      <description>&lt;LI-CODE lang="csharp"&gt;var Client = GetPowerBiClient(); 
var export = Await Client.Reports.ExportToFileAsync(reportId, exportRequest);&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;a href="https://community.fabric.microsoft.com/t5/user/viewprofilepage/user-id/100342"&gt;@lbendlin&lt;/a&gt;&amp;nbsp;If I leave the code as this, it never finishes processing. As a dev, to test, I'm willing to wait maybe 5 minutes, but I left it going for an hour withno results&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 13:07:28 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173560#M24310</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-22T13:07:28Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173641#M24311</link>
      <description>&lt;P&gt;According to the documentation:&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;A href="https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to" target="_blank" rel="noopener"&gt;https://docs.microsoft.com/en-us/power-bi/developer/embedded/export-to&lt;/A&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Quote: "The API is asynchronous. When the&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/reports/exporttofile" target="_blank" rel="noopener"&gt;exportToFile&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;API is called, it triggers an export job. After triggering an export job, use&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/reports/getexporttofilestatus" target="_blank" rel="noopener"&gt;polling&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;to track the job, until it's complete.&lt;/P&gt;&lt;P&gt;During polling, the API returns a number that represents the amount of work completed. The work in each export job is calculated based on the number of pages the report has. All pages have the same weight. If for example you're exporting a report with 10 pages, and the polling returns 70, it means that the API has processed seven out of the 10 pages in the export job.&lt;/P&gt;&lt;P&gt;When the export is complete, the polling API call returns a&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;&lt;A href="https://docs.microsoft.com/en-us/rest/api/power-bi/reports/getfileofexporttofile" target="_blank" rel="noopener"&gt;Power BI URL&lt;/A&gt;&lt;SPAN&gt;&amp;nbsp;&lt;/SPAN&gt;for getting the file. The URL will be available for 24 hours."&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 14:45:30 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173641#M24311</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-22T14:45:30Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173653#M24312</link>
      <description>&lt;P&gt;The export job never finishes.&lt;/P&gt;&lt;P&gt;It never hits the polling function.&lt;/P&gt;&lt;P&gt;The await on the export never comes back.&lt;/P&gt;&lt;P&gt;It should return in a second, max, because the report I'm exporting says only "Test"&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Is there some hidden setting or framework version I need to set my project to?&lt;/P&gt;&lt;P&gt;I'm copying the documentation code and it is not working.&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 14:50:33 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173653#M24312</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-22T14:50:33Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173701#M24313</link>
      <description>&lt;P&gt;Doesn't look like the sample code to me.&amp;nbsp; I think you are putting one "await"&amp;nbsp; on top of another one?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 15:03:47 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173701#M24313</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-22T15:03:47Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173719#M24314</link>
      <description>&lt;LI-CODE lang="csharp"&gt;/////// Export sample ///////
        public async Task&amp;lt;string&amp;gt; PostExportRequest(
            Guid reportId,
            Guid groupId,
            FileFormat format)
        {
            var client = GetPowerBiClient(); // new Power BI client instance
            var pages = client.Reports.GetPages(groupId, reportId);
            var powerBIReportExportConfiguration = new PowerBIReportExportConfiguration
            {
                Settings = new ExportReportSettings
                {
                    Locale = "en-us",
                },
            };
            var exportRequest = new ExportReportRequest
            {
                Format = format,
                PowerBIReportConfiguration = powerBIReportExportConfiguration,
            };
            Export export = null;
            try
            {
                export = await client.Reports.ExportToFileInGroupAsync(groupId, reportId, exportRequest); // this never returns
            }
            catch (Exception ex)
            {

            }

            // Save the export ID, you'll need it for polling and getting the exported file
            return export.Id;
        }&lt;/LI-CODE&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;Here's my full function.&amp;nbsp;&lt;BR /&gt;Do I have a double await?&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 15:06:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173719#M24314</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-22T15:06:21Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173802#M24318</link>
      <description>&lt;P&gt;You define the pages but then do not specify them in the request.&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;(You also use Export export instead of var export but I guess that doesn't matter)&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 15:28:40 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173802#M24318</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-22T15:28:40Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173941#M24320</link>
      <description>&lt;P&gt;I deleted the line with 'pages' since yes, I'm not using them.&lt;/P&gt;&lt;P&gt;If I don't specify pages, then it'll export the whole report, right?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 16:09:45 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173941#M24320</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-22T16:09:45Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173987#M24321</link>
      <description>&lt;P&gt;That would make too much sense.&amp;nbsp; So better test with specifying the pages , just in case...&lt;/P&gt;</description>
      <pubDate>Mon, 22 Jun 2020 16:20:46 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1173987#M24321</guid>
      <dc:creator>lbendlin</dc:creator>
      <dc:date>2020-06-22T16:20:46Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1179262#M24351</link>
      <description>&lt;P&gt;In the main application, the C# simply won't move past that line - do not know why. Nothing I do will work to move it past there.&lt;/P&gt;</description>
      <pubDate>Wed, 24 Jun 2020 12:22:54 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1179262#M24351</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-06-24T12:22:54Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1195325#M24487</link>
      <description>&lt;P&gt;I am stuck in the same spot as well.&amp;nbsp; The error I am getting is that the pageName is not declared&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;Pages = pageNames?.Select(pn =&amp;gt; &lt;/SPAN&gt;&lt;SPAN class="hljs-keyword"&gt;new&lt;/SPAN&gt;&lt;SPAN&gt; ExportReportPage(pageName = pn)).ToList(),&lt;/SPAN&gt;&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;&lt;SPAN&gt;does anyone know what pageName is supposed to be declared?&lt;/SPAN&gt;&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 14:27:11 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1195325#M24487</guid>
      <dc:creator>Juniorflip</dc:creator>
      <dc:date>2020-07-01T14:27:11Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1195337#M24488</link>
      <description>&lt;P&gt;Good news:&lt;BR /&gt;If you don't specify the pages there, it'll print the full report every time.&lt;/P&gt;&lt;P&gt;It also seems to default to "en-us" as the locale if you don't specify.&lt;/P&gt;&lt;P&gt;It actually needs very minimal configuration&lt;/P&gt;&lt;P&gt;Just giving it a format in the export request is enough for the configto be done and complete.&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 14:30:41 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1195337#M24488</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-01T14:30:41Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1195383#M24490</link>
      <description>&lt;P&gt;can you provide a code snippet of this part so that I can see?&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&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;/P&gt;&lt;P&gt;Pages = pageNames?.Select(pn =&amp;gt; new ExportReportPage(pageName = pn.ToString())).ToList(),&lt;/P&gt;&lt;P&gt;};&lt;BR /&gt;var exportRequest = new ExportReportRequest&lt;BR /&gt;{&lt;BR /&gt;Format = fileFormat,&lt;BR /&gt;PowerBIReportConfiguration = powerBIReportExportConfiguration,&lt;BR /&gt;};&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 14:44:50 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1195383#M24490</guid>
      <dc:creator>Juniorflip</dc:creator>
      <dc:date>2020-07-01T14:44:50Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1195444#M24492</link>
      <description>&lt;P&gt;var fileFormat = FileFormat.PDF&lt;BR /&gt;var exportRequest = new ExportReportRequest&lt;BR /&gt;{&lt;BR /&gt;Format = fileFormat&lt;BR /&gt;};&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;here you go. this should work&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 15:03:26 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1195444#M24492</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2020-07-01T15:03:26Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1195647#M24501</link>
      <description>&lt;P&gt;So I figure out my issue.&amp;nbsp; I was trying to export as .PNG.&amp;nbsp; When I did .PDF it works just fine.&amp;nbsp; Apparently there is a setting that need to be set in the admin portal for .PNG but I can't find it.&amp;nbsp; Does anyone have any luck enabling .PNG?&lt;/P&gt;</description>
      <pubDate>Wed, 01 Jul 2020 16:28:21 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1195647#M24501</guid>
      <dc:creator>Juniorflip</dc:creator>
      <dc:date>2020-07-01T16:28:21Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1852568#M29493</link>
      <description>&lt;P&gt;Have you found a resolution for this. Stuk with the same issue!&lt;/P&gt;</description>
      <pubDate>Wed, 19 May 2021 23:10:56 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/1852568#M29493</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-05-19T23:10:56Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/2248671#M33567</link>
      <description>&lt;P&gt;I found when I tried to export the file as a .PNG or a .CSV then the api call never worked and just hung permanently. But when I changed the export format to .PDF then it worked fine and the code was able to move on to the 'polling for export to finish' logic.&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 00:46:25 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/2248671#M33567</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-21T00:46:25Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/2248674#M33568</link>
      <description>&lt;P&gt;Thanks, changing the export file format to .PDF resolved this issue for me as well!&lt;/P&gt;</description>
      <pubDate>Tue, 21 Dec 2021 00:47:37 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/2248674#M33568</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-21T00:47:37Z</dc:date>
    </item>
    <item>
      <title>Re: Power BI Export to file Error</title>
      <link>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/2254498#M33608</link>
      <description>&lt;P&gt;hi, did you use the sample code that is in the&amp;nbsp; microsoft doc?&lt;/P&gt;&lt;P&gt;if not, can i see you your code .&lt;/P&gt;&lt;P&gt;&amp;nbsp;&lt;/P&gt;&lt;P&gt;thanks&lt;/P&gt;</description>
      <pubDate>Fri, 24 Dec 2021 00:50:59 GMT</pubDate>
      <guid>https://community.fabric.microsoft.com/t5/Developer/Power-BI-Export-to-file-Error/m-p/2254498#M33608</guid>
      <dc:creator>Anonymous</dc:creator>
      <dc:date>2021-12-24T00:50:59Z</dc:date>
    </item>
  </channel>
</rss>

