1

I have a problem with the ExportToFileInGroup API method. According to documentation, PowerBI reports can be exported to a few different formats, for me the most useful are PPTX, PDF, and PNG (https://learn.microsoft.com/en-us/rest/api/power-bi/reports/export-to-file-in-group#fileformat).

PPTX and PDF work fine but PNG throw exception. And that exception looks like licence problems "Operation returned an invalid status code 'Forbidden'" - I know that it is not exactly what it means but I noticed that for MS that often means that you didn't pay for that functionality. Is that possible that png format needs some extra licence?

Unfortunately, I need an image format to push that as a slack message and have an immediately preview.

  • 1
    One solution is not perfect but seems to be easy to implement, especially when the report will be exported page by page. Is to generate pptx, unzip and take png file from \ppt\media catalogue :) – Krzysztof Krysztofczyk Nov 12 '21 at 20:17
  • As noted in the link that you gave, PNG is supported only for paginated reports. The most obvious explanation it that your report is Power BI report and not a paginated report. – Andrey Nikolov Nov 13 '21 at 01:36
  • 1
    @andreyNikolov are you sure, I see that PNG is supported for standard reports: "Requested file format is PNG (only supported for Power BI reports)" – Krzysztof Krysztofczyk Nov 13 '21 at 21:37
  • 1
    You are right, it is supported. Csv/xlsx and few others were for paginated reports only – Andrey Nikolov Nov 13 '21 at 21:40
  • 1
    @kj looks that PPTX format if created by PowerBI API is very simple, one page - one image nothing more than that. So as general, that way is not proper for most of pptx, but probably will be working correctly with pptx generated by PowerBI API – Krzysztof Krysztofczyk Nov 13 '21 at 21:40

1 Answers1

1

I'm in the same boat - PDF and PPTX exports both work, but for PNG I get a 403-Forbidden response.

Found this: https://community.powerbi.com/t5/Developer/quot-Export-report-to-image-is-disabled-on-tenant-level-quot/m-p/1187677

...which indicates a tenant-level setting must be enabled, and the default is disabled. I'm not a tenant admin, so I don't know if this is the solution; will probably take me days get that turned on (assuming it exists), but I figured I'd share this in case it helps.

Greg
  • 11
  • 1
  • The easiest solution is to generate pptx. After that, you can unzip and you have png files. I use it that way for almost 3 months and works perfectly well :). If you will find any problem with that let me know. – Krzysztof Krysztofczyk Mar 05 '22 at 22:33