Forum Discussion
Power BI report server real time streaming data from Postgresql and embedding into HTML
- Anonymous1 year ago
Hello,Jessica_17 .Thank you for your reply.
You will need to contact a technician on your team who is proficient in Java Script (and other front-end page development languages) to assist you in embedding reports via front-end timed refreshes.
If your report is part of a front-end layout, I hope the following article will help.
I hope the following articles will help you.
URL:
How to Reload DIV in JavaScript | Delft Stack
Auto-refresh DIV every few Seconds using JavaScript and Ajax (encodedna.com)
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hi,Jessica_17 .Thank you for your reply.
If your report is part of a front end (embedded in a web page)
I would recommend trying to refresh the page tag where the report is embedded in your html via Java Script (I'm not sure if this is the way you mentioned in your reply)
like this:
function refreshDiv() {
// Get the div element that needs to be refreshed
var divElement = document.getElementById('yourDivId');
// Clear the current content of the div
divElement.innerHTML = '';
// Reload new content, this can be new data fetched from the server or static content
var newContent = '<p>This is the new content</p>';
divElement.innerHTML = newContent;
}
// Set an interval to refresh the div content every 60 seconds (60000 milliseconds)
setInterval(refreshDiv, 60000); // Refresh every 60000 milliseconds (60 seconds)
Note that if the embedded report has a very large amount of data, then you need to expand the time interval (e.g., perform a refresh once every two minutes) to avoid refreshing too often and keeping the entire embedded report consistently loading (i.e., the screenshot shown in your reply).
The above suggestions are for your report is embedded as a front-end page element in your html, looking forward to your reply.
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.
Hello Anonymous
Thanks for your constant support, I tried adding this piece of code in html part as well as tried in the console too. But it is not refreshing at all, let me know what I am doing wrong, here is the error of the console
and the html code on which I had embedded
<html>
<head>
<title>Seamless Power BI Report Refresh</title>
</head>
<body>
<h1>Embedded Power BI Report</h1>
<p>The report below will refresh automatically without reloading the page.</p>
<!-- iframe to load the Power BI report -->
<iframe id="reportIframe"
src="http://192.168.1.2/Reports/powerbi/Demo_DirectQuery?rs:embed=true"
title="Embedded Power BI Report"
style="width: 100%; height: 500px; border: none;"></iframe>
<script type="text/javascript">
// Set the refresh interval in milliseconds (e.g., 5 minutes = 300000 ms)
var refreshInterval = 6000; // 5 minutes
// Function to reload the iframe content
function refreshIframe() {
var iframe = document.getElementById('reportIframe');
iframe.src=iframe.src; // Refresh the iframe by reassigning the same source
}
// Set the interval to refresh the iframe content seamlessly
setInterval(refreshIframe, refreshInterval);
</script>
</body>
</html>
- Anonymous1 year agoNot applicable
Hello,Jessica_17 .Thank you for your reply.
You will need to contact a technician on your team who is proficient in Java Script (and other front-end page development languages) to assist you in embedding reports via front-end timed refreshes.
If your report is part of a front-end layout, I hope the following article will help.
I hope the following articles will help you.
URL:
How to Reload DIV in JavaScript | Delft Stack
Auto-refresh DIV every few Seconds using JavaScript and Ajax (encodedna.com)
I hope my suggestions give you good ideas, if you have any more questions, please clarify in a follow-up reply.
Best Regards,
Carson Jian,
If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.- Jessica_171 year agoHelper V
Thanks Anonymous
Thanks for the solution, This might help me solve the issue.