Forum Discussion
powerbi-oe
9 years agoFrequent Visitor
Power BI embedded: load report into web control in winforms application
Hi So I want to load a report hosted in an Azure workspace into a desktop application. Using the power bi cli, I've created a workspace and uploaded a pbix file. I've also got the embedurl for m...
Eric_Zhang
9 years agoMicrosoft Employee
powerbi-oe wrote:
I've managed to create a static HTML on disk and using the power bi JavaScript library load the report. I can then load the html file into a web browser control on a form.
You can do that but the embed token may expire. Although a token never expires can be generated but it is not recommended.
powerbi-oe
9 years agoFrequent Visitor
Yes it's to embed in a winforms based application.
I believe the token expires after an hour ? How does charging/licensing work with a token that never expires, as i thought each new token generated is the used for charging purposes?
Thanks
I believe the token expires after an hour ? How does charging/licensing work with a token that never expires, as i thought each new token generated is the used for charging purposes?
Thanks
- Eric_Zhang9 years agoMicrosoft Employee
powerbi-oe wrote:
Yes it's to embed in a winforms based application.
I believe the token expires after an hour ? How does charging/licensing work with a token that never expires, as i thought each new token generated is the used for charging purposes?
ThanksHow do you get your token at this moment?
Regarding a token never expires, check the sample in github.
var embedToken = PowerBIToken.CreateReportEmbedToken(this.workspaceCollection, this.workspaceId, report.Id,Convert.ToDateTime("2099-12-31"));- powerbi-oe9 years agoFrequent Visitor
I'm using the power bi CLI tool (https://github.com/Microsoft/PowerBI-Cli) to upload my pbix into a Azure workspace and then generate the required tokens.
Hope that makes sense? And thanks for your help!
- Eric_Zhang9 years agoMicrosoft Employee
If the "create-embed-token" doesn't accept an expire date parameter in your link, I'm afraid you'll have to download the git sample in my previous reply and following this tutorial. Then change the code by adding an extra parameter in the sample to get a token never expires.