cancel
Showing results for 
Search instead for 
Did you mean: 
0

Question on Using the ExportReportToFile API To Generate PDF and Image Files

Hi I am trying to generate PPT and Image from the Power BI Report (Embbed in Web Page). I have gone through the below video and following the provided the Steps.


https://www.youtube.com/watch?v=ybWWTVt_guA


I am facing some issues. Please help me out

Question No-1. Where can I find the "public-application-id" ?

Question No-2. Where can I find the "tenant-name" but I have found "tenant id" in azure portal ?

Question No-3. Where can I find the "confidential-application-id" but I have found "application-id" in azure portal ?

Question No-4. Where can I find the "confidential-application-secret" ?


Question No-5. When I pass the workspaceName ,it does not accept and shows the Inner Exception Number 1 and 2 ?


Question No-6. where can I find paginatedReportName?


Inner Exception 1:
AggregateException: One or more errors occurred. (A configuration issue is preventing authentication - check the error message from the server for details. You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000215: Invalid client secret is provided.
Trace ID: c8fd414b-c070-452d-bf63-c689b67af700
Correlation ID: 83b02cb2-2f8e-4ca8-b8cc-70a6844bfe35
Timestamp: 2022-01-14 12:22:56Z)

 

Inner Exception 2:
MsalServiceException: A configuration issue is preventing authentication - check the error message from the server for details. You can modify the configuration in the application registration portal. See https://aka.ms/msal-net-invalid-client for details. Original exception: AADSTS7000215: Invalid client secret is provided.
Trace ID: c8fd414b-c070-452d-bf63-c689b67af700
Correlation ID: 83b02cb2-2f8e-4ca8-b8cc-70a6844bfe35
Timestamp: 2022-01-14 12:22:56Z

 

With Regards

Bipin Kumar

Email Id - bipinksingh82@gmail.com

Mobile Number - 8860191188

Status: Delivered

Hi @spc-powerb 

 

There are two kinds of Embed solutions. One is called Embed for your customers, and another is called Embed for your organization. To learn the differences between these two solutions to help you make a better choice, you can read this official document. And both of them have some requirements, and you can refer to Prerequisites for Embed for your customers and Prerequisites for Embed for your organization.

 

And the Embed processes are always like this.

  • Determine authentication method
  • Register an Azure AD application in Azure portal
  • Create a Power BI workspace
  • Create and publish a Power BI report
  • Get the embedding parameter values
  • Service principal API access
  • Enable workspace access
  • Embed content

 

Question No-1. Where can I find the "public-application-id" ?

As mentioned above, you need register an application in Azure portal. Once you complete the register, you can get it in it by Home>App registrations>Find your application and its application id.

vcazhengmsft_0-1642391895455.png

 

 

Question No-2. Where can I find the "tenant-name" but I have found "tenant id" in azure portal ?

You can search Azure Active Directory in Azure portal and go to the Overview page or your tenant. Then, you will see it.

vcazhengmsft_0-1642392273918.png

 

Question No-3. Where can I find the "confidential-application-id" but I have found "application-id" in azure portal ?

If you are embedding for your customers and you determine they need to be authenticated with a service principal. Normally, you need do an operation called Create Client secret. And the Secret ID should be the confidential application id.

vcazhengmsft_2-1642391895469.png

 

vcazhengmsft_3-1642391895473.png

 

Question No-4. Where can I find the "confidential-application-secret" ?

It should be the Client secret Value in the following screenshot.

vcazhengmsft_4-1642391895480.png


Question No-5. When I pass the workspace Name ,it does not accept and shows the Inner Exception Number 1 and 2 ?

As the error information said you don’t provide invalid client secret. Please check according to the Embed processes above to provide proper information to run it.


Question No-6. where can I find paginated Report Name?

You can find the name of your report or Paginated report in its workspace in Power BI service(app.powerbi.com) if you have publish it to Power BI service(app.powerbi.com).

vcazhengmsft_5-1642391895489.png

 

If you don’t have paginated report, you can download a sample paginated file for test by this link.

 

In addition, please refer to this blog to learn how to use Power BI Rest API to export your report to PDF.

 

Best Regards,

Community Support Team _ Caiyun

 

Comments
v-cazheng-msft
Community Support
Status changed to: Delivered

Hi @spc-powerb 

 

There are two kinds of Embed solutions. One is called Embed for your customers, and another is called Embed for your organization. To learn the differences between these two solutions to help you make a better choice, you can read this official document. And both of them have some requirements, and you can refer to Prerequisites for Embed for your customers and Prerequisites for Embed for your organization.

 

And the Embed processes are always like this.

  • Determine authentication method
  • Register an Azure AD application in Azure portal
  • Create a Power BI workspace
  • Create and publish a Power BI report
  • Get the embedding parameter values
  • Service principal API access
  • Enable workspace access
  • Embed content

 

Question No-1. Where can I find the "public-application-id" ?

As mentioned above, you need register an application in Azure portal. Once you complete the register, you can get it in it by Home>App registrations>Find your application and its application id.

vcazhengmsft_0-1642391895455.png

 

 

Question No-2. Where can I find the "tenant-name" but I have found "tenant id" in azure portal ?

You can search Azure Active Directory in Azure portal and go to the Overview page or your tenant. Then, you will see it.

vcazhengmsft_0-1642392273918.png

 

Question No-3. Where can I find the "confidential-application-id" but I have found "application-id" in azure portal ?

If you are embedding for your customers and you determine they need to be authenticated with a service principal. Normally, you need do an operation called Create Client secret. And the Secret ID should be the confidential application id.

vcazhengmsft_2-1642391895469.png

 

vcazhengmsft_3-1642391895473.png

 

Question No-4. Where can I find the "confidential-application-secret" ?

It should be the Client secret Value in the following screenshot.

vcazhengmsft_4-1642391895480.png


Question No-5. When I pass the workspace Name ,it does not accept and shows the Inner Exception Number 1 and 2 ?

As the error information said you don’t provide invalid client secret. Please check according to the Embed processes above to provide proper information to run it.


Question No-6. where can I find paginated Report Name?

You can find the name of your report or Paginated report in its workspace in Power BI service(app.powerbi.com) if you have publish it to Power BI service(app.powerbi.com).

vcazhengmsft_5-1642391895489.png

 

If you don’t have paginated report, you can download a sample paginated file for test by this link.

 

In addition, please refer to this blog to learn how to use Power BI Rest API to export your report to PDF.

 

Best Regards,

Community Support Team _ Caiyun

 

spc-powerb
Frequent Visitor

Hi

        Thank you for your support.

   I am trying to generate PPTX and Image from Power BI Report (Embbed in Web Page) . I have gone throught the below link and follwing the provided the Steps. and getting the PPTX Report from POSTMAN

 

In addition, please refer to this blog to learn how to use Power BI Rest API to export your report to PDF.

 

Question No-1. Please provide the blog to use Power BI Rest API to export report to PPTX on ASP.Net with MVC and C # and Please share the sample code for generate report to PPTX using ASP.Net with C# Web Page

 

With Regards

Bipin Kumar

bipinksingh82@gmail.com

spc-powerb
Frequent Visitor

Hi,

       I am using the following method to get response from PowerBi Api,but it is generating the following error.

 

function GeneratePPTX() {
var model = {
groupid: "56811d8e-a609-435e-853e-c813fb83b7b8",
reportid: "0f45ebe1-58ac-4331-ab62-48d0984d1174",
};
var bodyModel = { format:"PPTX"}
// Entering power bi data into tables to show report
var token = "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Jvc29mdC5jb20iLCJ1cG4iOiJzcGMtcG93ZXJiaUBzcGNtb2JpbGVwcm9ncmFtbWluZ2xsYy5vbm1pY3Jvc29mdC5jb20iLCJ1dGkiOiJoX281bG51NTZFS2tfbFc2V2NnTkFRIiwidmVyIjoiMS4wIiwid2lkcyI6WyJkMjRhZWY1Ny0xNTAwLTQwNzAtODRkYi0yNjY2ZjI5Y2Y5NjYiLCJhOWVhODk5Ni0xMjJmLTRjNzQtOTUyMC04ZWRjZDE5MjgyNmMiLCJiNzlmYmY0ZC0zZWY5LTQ2ODktODE0My03NmIxOTRlODU1MDkiXX0.laD1VB_mHmP1aWYF7_bVamtXaxT5PANwORndzAbYQklWlPpSOGyCnAD5BkWuVsoGDHjol-gOJm37sLfn3eHeHGewhhJGjYeTVS3xdEIjxjyCqxg9aQH7GbgSRxfTxzNpsZwVTmDnbGgjXA0SfvMLfY1SGG2FTmi3J7rZ6OZevSkU-C9KaSCJ3dJluHko9d_CMxFyY_93OKdju8D3K1_p5y_LfiRI0dVBeafsscDIOMI2f5l6Tvp_FCS0JY5O38jddBxxHHSotmLSFN6zQXGrQp2fB4UxaNrM8ZC5jrkC6NNbodnecfMSVhC0uxYby-v6JFMadWRYQ5l6PA6fALJUhg";
var headers = {};
if (token) {
headers.Authorization = 'Bearer ' + token;
}
$.ajax({
url: 'https://api.powerbi.com/v1.0/myorg/groups/56811d8e-a609-435e-853e-c813fb83b7b8/reports/0f45ebe1-58ac...',
data: JSON.stringify({
"accessLevel": "View"
}),
type: 'POST',
cache: false,
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${token}`
},
body: {
"format": "PPTX",
},
async: false,
success: function (result) {
alert('Text');
if (result == 1) {
dataFound = 1;
}
else {
dataFound = 0;
}
},
error: function (result) {
debugger
var tt = result;
alert(result);
}
});
}

 

--- I am getting the following Error

{"error":{"code":"BadRequest","message":"Bad Request","details":[{"message":"Required property 'format' not found in JSON. Path '', line 1, position 22.","target":"request"}]}}`