The ultimate Fabric, Power BI, SQL, and AI community-led learning event. Save €200 with code FABCOMM.
Get registeredEnhance your career with this limited time 50% discount on Fabric and Power BI exams. Ends August 31st. Request your voucher.
Hello everyone,
I'm encountering an issue while trying to embed Paginated Reports in with AllowEdit option as True. Every time I add to allowEdit a Paginated Report, I receive the Response message: "Resource access type 'Edit' unsupported for Paginated Reports."
I've searched through the documentation, but I couldn't find any relevant information about this specific error.
Has anyone else experienced this issue? If so, how did you resolve it? Any insights or suggestions would be greatly appreciated.
In this document it is mentiond that allowEdit must set to false
Embed a paginated report - Power BI | Microsoft Learn
and in another document its not mentioned
Embed Token - Generate Token - REST API (Power BI Power BI REST APIs) | Microsoft Learn
Here is a code snippet
static async Task Main(string[] args)
{
var credential = new ClientCredential(Constants.ClientID, Constants.ClientSecrete);
// Authenticate using created credentials
var authenticationContext = new AuthenticationContext(Constants.AuthorityURL);
var authenticationResult = await authenticationContext.AcquireTokenAsync("https://analysis.windows.net/powerbi/api", credential);
if (authenticationResult == null)
throw new Exception("Report Authentication Failed");
var tokenCredentials = new TokenCredentials(authenticationResult.AccessToken, "Bearer");
using (var client = new PowerBIClient(new Uri("https://api.powerbi.com/"), tokenCredentials))
{
{
var reports = await client.Reports.GetReportsInGroupAsync(Guid.Parse(Constants.WorkspaceId));
// 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 tokenRequest = new GenerateTokenRequestV2(
reports: new List<GenerateTokenRequestV2Report>() { new GenerateTokenRequestV2Report(report.Id, true) },
datasets: null,
targetWorkspaces: new List<GenerateTokenRequestV2TargetWorkspace>() { new GenerateTokenRequestV2TargetWorkspace(Guid.Parse(Constants.WorkspaceId)) },
identities: null
);
var tokenResponse = client.EmbedToken.GenerateToken(tokenRequest);
}
}
}
}
Can someone guide me?
Thank you!
Hi @JyotiJadhav ,
The error message indicates that the ‘Edit’ access type is incompatible with Paginated Reports, prohibiting the activation of the AllowEdit option. Given the static and less interactive nature of Paginated Reports, the allowEdit option may not be applicable during embedding. The error is likely triggered by the activation of the allowEdit option for the GenerateTokenRequestV2Report object in your code. Please consider the following modification:
var tokenRequest = new GenerateTokenRequestV2( reports: new List<GenerateTokenRequestV2Report>() { new GenerateTokenRequestV2Report(report.Id, false) }, datasets: null, targetWorkspaces: new List<GenerateTokenRequestV2TargetWorkspace>() { new GenerateTokenRequestV2TargetWorkspace(Guid.Parse(Constants.WorkspaceId)) }, identities: null ); |
Best Regards