Earn the coveted Fabric Analytics Engineer certification. 100% off your exam for a limited time only!
hey everybody,
is it possible to create real time report's from sql server 2008 r2 with rest api?
i cant get my connection to work via rest api-
thanks in advanceeeeeeeeeeeeeeeeeeeeeeee
As per the snapshot, so you are using Power BI Embedded, right?
To push data via REST API, you can
https://api.powerbi.com/v1.0/collections/{workspacecollectionName}/workspaces/{workspaceId}/datasets/{DatasetId}/tables/{TableName}/rows
<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 = 'YourCreationTokenHere';
// Read embed URL from textbox
var txtEmbedUrl = 'https://embedded.powerbi.com/appTokenReportEmbed';
// Read dataset Id from textbox
var txtEmbedDatasetId = 'yourDatasetIDhere';
// 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>
You can keep pushing data following step 2 with data extracted from SQL Server in whatever way after after the report created.
hey eric,thank you for the reply-
I'm able to use any other suggestion you have to create real-time dashboard.
After looking all over the community and over the web ifount that the best solution is via REst API.
Do you have any other suggestions for my scenario?
ps-
I must have an Azure profile to get my tokens?
I dont Use any Azure services-ALl my data side is local servers with SQL 2008 R2.
@nadavfishman wrote:
hey eric,thank you for the reply-
I'm able to use any other suggestion you have to create real-time dashboard.
After looking all over the community and over the web ifount that the best solution is via REst API.
Do you have any other suggestions for my scenario?
ps-
I must have an Azure profile to get my tokens?
I dont Use any Azure services-ALl my data side is local servers with SQL 2008 R2.
No for streaming dataset. The provided url contains the access security info.
User | Count |
---|---|
18 | |
11 | |
5 | |
4 | |
3 |