cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
Highlighted
Frequent Visitor

report.print() does not print entire iframe, some parts are missing.

I have an asp.net page. I am embedding my powerbi report:

 

var config = {
type: 'report',
tokenType: 1,

accessToken: token,
pageView: 'fitToWidth',
embedUrl: embedurl,
id: reportid,

permissions: 7,
settings: {
   filterPaneEnabled: true,
   background: 0, //set 1 to remove grey background.
   navContentPaneEnabled: true,
   layoutType: 1,
   customLayout: {
      displayOption: 2
   }
}
};

var reportContainer = document.getElementById('reportContainer');
var report = powerbi.embed(reportContainer, config);

 

I have print button: 

<button type="button" class="btn btn-danger dropdown-toggle" style="margin-left:3px;" onclick="myfunction()">
   <span> Print page </span>
</button>

 

and function to print:

 

function myfunction() {
   var repcon = document.getElementById('reportContainer');
   var rep = powerbi.get(reportContainer);

   rep.print();
}

 

My problem is, it is not printing all the iframe but a part of it only, like 300% zoomed-in print. Same problem with this person: https://stackoverflow.com/questions/42049025/embedded-media-on-iframe-zooms-in-windows-print/4205217...

 

I am using Chrome. Could not find a way to handle it. Also explained here: https://stackoverflow.com/questions/55067770/how-to-disable-mediaprint-while-printing-content-of-ifr...

 

Any help would be appreciated. Regards.

1 REPLY 1
Highlighted
New Member

Re: report.print() does not print entire iframe, some parts are missing.

Any progress on this? I have the same problem with a React based application and the problem persists on all browsers. Media queries don't seem to have any effect on the parent div or the iframe. I haven't found any solution for this, only people who are struggling with the same problem.

Helpful resources

Announcements
Meet the 2020 Season 2 Power BI Super Users!

Meet the 2020 Season 2 Power BI Super Users!

Find out who's part of the program this season, and welcome the new Super Users.

August 2020 Community Challenge: Can You Solve These?

August 2020 Community Challenge: Can You Solve These?

We're excited to announce our first cross-community 'Can You Solve These?' challenge!

July 2020 Community Highlights

July 2020 Community Highlights

Learn about the exciting things that happened in July.

Featured Data Story of The Month

Featured Data Story of The Month

All Data Stories Gallery contributions are reviewed for each month. We select a contribution and feature the community member the following month.

Power BI Dev Camp - Developing with .NET Core

Power BI Dev Camp - Developing with .NET Core

Learn how to develop custom web applications for Power BI using .NET Core 3.1 and .NET 5.