Forum Discussion
Anonymous
3 years agoNot applicable
printing report from embedded iframe
Looking for a solution to printing a report from an embedded iframe.
I have tried adding powerbi.js and using the following code:
<a href='#' id="printit">Print</a>
$("#printit").click(function() {
var element = $('#report-container')[0];
var report = powerbi.get(element);
report.print();
}
According to Microsoft docs this should work, however, I receive the following error:
You attempted to get an instance of powerbi component associated with element... but there was no associated instance
I have also tried printing the iframe contents, but of course run into a CORS issue.
Any advice is much appreciated!
No Replies