Register now to learn Fabric in free live sessions led by the best Microsoft experts. From Apr 16 to May 9, in English and Spanish.
Hi all,
I'm trying to embed Power BI report & dashboard in a custom mobile app. I use webview (because I see there is no API besides Javascipt) to display the report in my mobile apps. The embedded report is running, but i found this grey box when I try to interact with it and the user find it a little bit disturbing.
Is there another way to embed the report to my mobile apps without webview / to get the same user experience with the PowerBI Mobile apps?
Hi @eddywijaya,
I use webview (because I see there is no API besides Javascipt) to display the report in my mobile apps.
Are you using the PowerBI-JavaScript Embed For Mobile sample code to embed the report in your mobile application?
Could you share some sample code you're using which can help us reproduce the issue, so that we can better assist on it?
Regards
Hi @v-ljerr-msft, thank you for replying
I'm developing this for iOS application.
In order to display the Power BI report in iOS device : I put the html file in the asset (xcode project) and then load it into a WebView. I followed the microsoft's live demo, so first I prepare a <div> container like this :
<div id="reportContainer"></div>
and then call the Power BI to embed in my container with the javascript SDK
var embedUrl = "https://app.powerbi.com/dashboardEmbed?dashboardId=e982axxx-5xxx-44b1-ae35-66axxxxxxxxx"; var config = { type: 'dashboard', accessToken: accessToken, embedUrl: embedUrl }; var dashboardContainer = document.getElementById('dashboardContainer'); var dashboard = powerbi.embed(dashboardContainer, config);
Then, in the iOS application I load that html file in a webview (with WKWebView) :
@property (strong, nonatomic) IBOutlet WKWebView *dashboardWV; NSString *filePath=[[NSBundle mainBundle]pathForResource:@"BI" ofType:@"html" inDirectory:@"powerbi"]; NSURL *url = [NSURL fileURLWithPath: filePath]; NSURLRequest* request = [NSURLRequest requestWithURL:url]; [dashboardWV loadRequest:request];
Are you using the PowerBI-JavaScript Embed For Mobile sample code to embed the report in your mobile application?
Not yet, but I think it will only change the layout of the report. We have no problem with the layout displayed since we are only using iPad / Tablet for our application. But I'll try that, thanks for the information.
Covering the world! 9:00-10:30 AM Sydney, 4:00-5:30 PM CET (Paris/Berlin), 7:00-8:30 PM Mexico City
Check out the April 2024 Power BI update to learn about new features.
User | Count |
---|---|
12 | |
2 | |
2 | |
1 | |
1 |