Forum Discussion
Embedding Paginated Report with a Power BI Dataset
This is now available. You should use the latest .Net SDK, see some guidance here:
Thanks,
Amos
So, we have implemented the code in our .net application and we are able to see our paginated report through our embedded web application. However, we are seeing an issue where the provided EffectiveIdentity username is not showing correctly in the Paginated Report's username parameter. This parameter is showing the &User.UserId property, however, this value has the service principal GUID instead of the effective identity username provided in the api call. Code in call:
generateTokenRequestV2Parameters = new GenerateTokenRequestV2(datasets: dataSetIdV2, reports: reportIdV2, identities: new List<EffectiveIdentity> { new EffectiveIdentity(username: upn, roles: new List<string> { roleName }, datasets: new List<string> { dataSetId }) });
accessToken = client.EmbedToken.GenerateToken(generateTokenRequestV2Parameters);
The upn value in this case is my email address '[email protected]', which should show up in the pagainated report parameter for &User.UserId instead of the SPN GUID.
- AmosHersch4 years agoMicrosoft Employee
Hi,
When you provide an effective identity in the generateToken request it should either be an effective identity for the paginated report or an effective identity for the Power BI dataset.
If you want the username to be the identity passed to the report then should should provide the reportId and not the datasetId. Something like this:
new EffectiveIdentity(username: upn, , reports: new List<string> { reportId })
In addition you can specify another identity for the dataset, with the roles, etc.
Thanks,
Amos
- Anonymous4 years agoNot applicable
Thank you, that was very helpful. In order to make it work, I had to provide both identities (one for report, one for dataset) otherwise I would get a bad request error. Would you happen to have any documentation on using multiple identities? I don't think I would have ever thought to do that, so thank you.
- AmosHersch4 years agoMicrosoft Employee
Glad to hear it worked for you.
I don't think there's a documentation for the case of multiple identities, there's a request sample for 2 identities for 2 different datasets, but that's a different case
We might add such a sample request for the case of paginated report + Power BI dataset in the future.