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.
Can anyone give me some code reference from where i can use .NET sdk/ Javascript API to perform following task:
create workspace collection
Create workspace
create dataset
create new reports
publish reports
create new dashboard
pin items to dashboard
same can be updated/deleted.
My Requirement is to achive these tasks using pure web application, no windows/console.
I appreciate your help.
Thank you.
@mdsajidfaizan wrote:
Can anyone give me some code reference from where i can use .NET sdk/ Javascript API to perform following task:
create workspace collection
Create workspace
create dataset
create new reports
publish reports
create new dashboard
pin items to dashboard
same can be updated/deleted.
My Requirement is to achive these tasks using pure web application, no windows/console.
I appreciate your help.
Thank you.
I see "create workspace collection“, so I think you're using Power BI Embedded. In Power BI Embedded, there's no dashboard. For both Power BI service and Power BI Embedded, there're no such REST APIs to create/edit reports, dashboards or tiles. For the rest of your requirement, you can reference this github repo. The ProvisionSample covers most of your requirements.
Hello Eric,
I thank you for clearing my base. I also understand the limitations of each API/Methods.
But i am not able to perform all my tasks, as i have to use only web application interface in single application, i can't use desktop/console here. I am still working on the console applicaiton sample and trying it to convert into web. Meanwhile if you see any other option to close all my needs, it would be very helpful.
I will look forward to get more clarifications/any other work around which suits the business.
But microsoft should think once before releasing any API which has limitations, if a developer cant perform certain task for a technology which costs money, it is really an annoying thing.
Thank you.
@mdsajidfaizan wrote:
Hello Eric,
I thank you for clearing my base. I also understand the limitations of each API/Methods.
But i am not able to perform all my tasks, as i have to use only web application interface in single application, i can't use desktop/console here. I am still working on the console applicaiton sample and trying it to convert into web. Meanwhile if you see any other option to close all my needs, it would be very helpful.
I will look forward to get more clarifications/any other work around which suits the business.
But microsoft should think once before releasing any API which has limitations, if a developer cant perform certain task for a technology which costs money, it is really an annoying thing.
Thank you.
I was inspired by someone in the community and have some new findings here. Actually it is possible to create a report when embeding in your own app. Check below demo. You can actually embedded a report desiner panel in your application. Just copy the code in a .html file and open it in Chrome. See more demos here.
<html> <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/jquery/dist/jquery.js"></script> <script src="https://microsoft.github.io/PowerBI-JavaScript/demo/node_modules/powerbi-client/dist/powerbi.js"></script> <script type="text/javascript"> window.onload = function () { // Read embed application token from textbox var txtAccessToken = 'eyJ0eXAiOiJKV1QiLCJhbGciOiJIUzI1NiJ9.eyJ2ZXIiOiIwLjIuMCIsInR5cGUiOiJlbWJlZCIsIndjbiI6IlBvd2VyQmlBenVyZVNhbXBsZXMiLCJ3aWQiOiJmODFjMTk2Ni1lZGVlLTQxMWItOGY4YS1mODQ0NjAxOWIwNDQiLCJkaWQiOiIxZWUwYjI2NC1iMjgwLTQzZjEtYmJiNy05ZDhiZDJkMDNhNzgiLCJzY3AiOiJEYXRhc2V0LlJlYWQiLCJpc3MiOiJQb3dlckJJU0RLIiwiYXVkIjoiaHR0cHM6Ly9hbmFseXNpcy53aW5kb3dzLm5ldC9wb3dlcmJpL2FwaSIsImV4cCI6MTk2MTg1NDIzNiwibmJmIjoxNDg4NDY4NjM2fQ.Udv5Y6gMrTKUw0-5mXeCwud8u4JI5Y5loAwJc2jWugQ'; // Read embed URL from textbox var txtEmbedUrl = 'https://embedded.powerbi.com/appTokenReportEmbed'; // Read dataset Id from textbox var txtEmbedDatasetId = '1ee0b264-b280-43f1-bbb7-9d8bd2d03a78'; // Embed create configuration used to describe the what and how to create report. // This object is used when calling powerbi.createReport. var embedCreateConfiguration = { accessToken: txtAccessToken, embedUrl: txtEmbedUrl, datasetId: txtEmbedDatasetId, }; // Grab the reference to the div HTML element that will host the report var reportContainer = $('#reportContainer')[0]; // Create report var report = powerbi.createReport(reportContainer, embedCreateConfiguration); // Report.off removes a given event handler if it exists. report.off("loaded"); // Report.on will add an event handler which prints to Log window. report.on("loaded", function() { Log.logText("Loaded"); }); report.off("error"); report.on("error", function(event) { Log.log(event.detail); }); // report.off removes a given event handler if it exists. report.off("saved"); report.on("saved", function(event) { Log.log(event.detail); Log.logText('In order to interact with the new report, create a new token and load the new report'); }); } </script> <div id="reportContainer" ></div> </html>
Hi Eric,
I have tried the above html code for creating an Report but no data is getting dispalyed for me I have replaced Access Token,Embedded Url and Datasetid but still no data is getting dispalyed.
Please kindly help me on this.
Thanks
Vannikannan.k
Hi,
The coode provided in last thread response is a good sample of a common 'classic' Power BI Embedded: JavaScript - HTML 'report' rendering scenario.
If you're looking for samples in JavaScript context you can still have a look at both approaches linked below:
Before you dive too deep, it's important to make a clear distinction between the two approaches listed above
as Microsoft Team announced significant changes regarding upcoming convergence between the two.
Microsoft Team claimed you'll still be able to use Power BI Embedded for a certain time,
though strongly suggest aiming at second...
The first link refers to what I would call the 'classic' Power BI Embedded - Workspace Collection -Workspace model topology
used in a JavaScript-HTML context. I personally found Jon's explanation to be a concise and straight forward explanation from start-to-end.
So you would first need to create a Workspace Collections on Azure Portal account then use PowerBI-CLI interface
a to 'provision' data. Jon gives a clear step-by-step description on how it's done.
In the case of second link: Power BI API - Integrate a dashboard into an app
you'll somehow need to go through a different process...
So in order to take advantage of the second Power BI API approach, you will first have to register an application with your Azure Active Directory tenant.
Main reason is, you'll need to do this first so that you have a Client ID and Client Secret that identifies your registered web app in Azure AD.
Without a Client ID and Client Secret, Azure AD cannot authenticate your web application. In the Integrate a dashboard sample, you use the Client ID and Client Secret you get after registration to configure the sample application,
so that the sample can authenticate to Azure AD. In the end, users will be asked to sign on their [ Power BI Pro...] account, after which they'll see a list of available registered dashboards. Clicking on list option element should display the requested dashboard.
In the end, the client iFrame rendering process is pretty similar in both cases - as you'll still need to provision same [AccessToken, EmbedUrl, ReportID|DashboardID]
attribute parameters in order to display the adequate content you requested. What mainly changes is where and how you will provide those... 😉
Hope this helps.
https://msdn.microsoft.com/en-us/library/mt147898.aspx
Hello Smoupre, I visited to this page earlier, it does not have functionalities which i need.
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 |
---|---|
17 | |
2 | |
2 | |
1 | |
1 |