Forum Discussion
Paginated report not embedding inside update panel ASP.net
Hi Anonymous
You're encountering a common issue when embedding Power BI reports—especially Paginated reports—within an ASP.NET Web Forms application that uses UpdatePanel for partial page updates. The problem arises because Power BI’s JavaScript SDK dynamically injects and controls the report rendering via the DOM, and UpdatePanel interferes with that process due to how it handles partial postbacks. Specifically, when a postback occurs inside an UpdatePanel, it replaces the inner HTML of the update panel, which can remove or disrupt the JavaScript-initialized Power BI container, preventing the Paginated report from rendering properly.
When you place the Power BI embed code inside the UpdatePanel, the JavaScript execution might be interrupted or not re-triggered after the async postback, resulting in a blank or unresponsive Power BI container. However, placing the Power BI embedding logic outside the UpdatePanel avoids this problem because the full page lifecycle isn't interrupted, allowing the SDK to initialize and render the report correctly.
To work around this, you have two options:
Move the Power BI embedding logic outside the UpdatePanel and trigger updates via JavaScript or server-side logic that doesn’t require a partial postback.
If you must use UpdatePanel, use the Sys.Application.add_load() method in ASP.NET AJAX to re-run your embedding JavaScript after every partial postback. For example:
Sys.Application.add_load(function () {
// your Power BI embed code here
});
This ensures the SDK re-initializes after the DOM is updated.
Hi Poojara, i tried this, still not working.
FYI. the Power BI pagninated report should work inside update panel on a button Onclick eg: OnClick="btnGenerateReport_Click" this method fills ReportId,
EmbedUrl = embedInfo.embedUrl;
EmbedToken = embedInfo.embedToken;
Once the variable filled then should hit the Javascript SDK . Below are the code snippet i am trying inside update panel but not working.
<asp:Button ID="btnGenerateReport" runat="server" Text="Generate Report" CssClass="genric_btn green" OnClick="btnGenerateReport_Click" />
<div id="powerBIReportContainer" style="height:600px;width:100%;"></div>
<script src="https://cdn.jsdelivr.net/npm/[email protected]/dist/powerbi.js"></script>
<script type="text/javascript">
Sys.Application.add_load(function () {
embedPowerBIReport();
});
var embedUrl = '<%= EmbedUrl %>';
var embedToken = '<%= EmbedToken %>';
var reportId = '<%= ReportId %>';
function embedPowerBIReport() {
if (!embedUrl || !embedToken || !reportId) return;
var models = window['powerbi-client'].models;
var embedConfig = {
type: 'report',
isPaginatedReport: true,
id: reportId,
embedUrl: embedUrl,
accessToken: embedToken,
tokenType: models.TokenType.Embed,
settings: {
panes: {
filters: { expanded: false, visible: false },
pageNavigation: { visible: true },
parameters: { expanded: false, visible: false }
},
navContentPaneEnabled: false,
parameterPaneEnabled: false
}
};
var reportContainer = document.getElementById('powerBIReportContainer');
powerbi.reset(reportContainer);
var report = powerbi.embed(reportContainer, embedConfig);
// Show page navigation after report is loaded
report.on("loaded", function () {
report.updateSettings({
panes: {
pageNavigation: { expanded: false, visible: true },
filters: { visible: false },
parameters: { expanded: false, visible: false }
},
parameterPaneEnabled: false
});
});
}
</script>
- v-ssriganesh1 year ago
Community Support
Hello Anonymous,
We regret the inconvenience caused. Please consider raising a Microsoft support ticket for further investigation. You can explain all the troubleshooting steps you have taken to help them better understand the issue.
You can create a Microsoft support ticket with the help of the link below:
https://learn.microsoft.com/en-us/power-bi/support/create-support-ticketIf this helps, please accept it as a solution and drop a "Kudos" so other members can find it more easily.
Thank you.
- v-ssriganesh1 year ago
Community Support
Hello Anonymous,
Could you please confirm if the issue has been resolved after raising a support case? If a solution has been found, it would be greatly appreciated if you could share your insights with the community. This would be helpful for other members who may encounter similar issues.
Thank you for your understanding and assistance.