Forum Discussion
Embedded paginated report with PowerBI dataset
- 4 years ago
Hi JAnder ,
The way I am using for obtaining the dataset ID programatically is by calling "Reports - Get Datasources" API https://docs.microsoft.com/en-gb/rest/api/power-bi/reports/get-datasources-in-group the datasource representing the Power BI Dataset will have in the ConnectionDetails.Database something like
sobe_wowvirtualserver-<DatasetID> .Regarding code sample, I don't think there's a code sample for this specific case, but any sample for embedding RDL report should work, besides the change in generateToken request which should look similar to this: - 4 years ago
I posed a code sample here that shows how to get the embed token using the Microsoft.PowerBi.APi nuget: Solved: Re: Paginated Report embedding using a Power BI Da... - Microsoft Power BI Community
Thanks AmosHersch for the info. Much appreciated.
I posed a code sample here that shows how to get the embed token using the Microsoft.PowerBi.APi nuget: Solved: Re: Paginated Report embedding using a Power BI Da... - Microsoft Power BI Community
- JAnder4 years agoHelper II
I am getting bad request on this, I can't spot any deviation from the working example.
The effective identity contains the reportId, datasetId and username.
Any ideas?
var reports = new List<GenerateTokenRequestV2Report>() { new GenerateTokenRequestV2Report(report.Id) }; var datasets = new List<GenerateTokenRequestV2Dataset>() { new GenerateTokenRequestV2Dataset(datasetId, XmlaPermissions.ReadOnly) }; var workspaces = new List<GenerateTokenRequestV2TargetWorkspace>() { new GenerateTokenRequestV2TargetWorkspace(groupId) }; var identities = new List<EffectiveIdentity>() { effectiveIdentity }; var tokenRequest = new GenerateTokenRequestV2(datasets, reports, workspaces, identities); var embedToken = client.EmbedToken.GenerateToken(tokenRequest); return embedToken;