Forum Discussion

JyotiJadhav's avatar
JyotiJadhav
Frequent Visitor
2 years ago

How to Add "Edit in Report Builder" Option in Embedded Paginated Power BI report

Hello,

 

I'm currently working on embedding a paginated Power BI report, and I'm interested in providing users with the option to "Edit in Report Builder."

Could you please assist me by providing guidance on whether this feature can be implemented for embedded paginated reports?

If so, could you kindly outline the steps or any documentation that could help me achieve this?

Thank you very much for your assistance.

 

Thanks & regards,

Jyoti Jadhav

2 Replies

    • JyotiJadhav's avatar
      JyotiJadhav
      Frequent Visitor

      Hello,

      I am trying below code :

       using (var client = new PowerBIClient(new Uri("https://api.powerbi.com/"), tokenCredentials))
       {
           {
               var reports = await client.Reports.GetReportsInGroupAsync("MyWorkSpaceID");
      
               // No reports retrieved for the given workspace.
               if (!reports.Value.Any())
                   throw new Exception("No reports were found in the workspace");
      
               foreach (var report in reports.Value)
               {
                   Console.WriteLine($"Report Name: {report.Name}");
                   Console.WriteLine($"Report ID: {report.Id}");
                   Console.WriteLine();
      
                   var generateTokenRequest = new GenerateTokenRequestV2();
      
                  generateTokenRequest.Reports = new List<GenerateTokenRequestV2Report> { new GenerateTokenRequestV2Report { Id = report.Id, AllowEdit = true } };
                       var tokenResponse =  client.EmbedToken.GenerateToken(generateTokenRequest);
                  
           }
       }
      }

      On line  var tokenResponse = client.EmbedToken.GenerateToken(generateTokenRequest);

      I am getting response as 

      Could you help me to understand what went wrong here?

      Thank you in advance for your time and help!

       

      Regards,

      Jyoti