Forum Discussion

mganji's avatar
mganji
Regular Visitor
5 years ago

Power BI Client JS Unable to Print Report In Edge

Hi Team,

 

we are using power bi client js report.print() method to print the underlying report content.Code works fine in Chrome. But it does not work  when try to print same page twice or print page 2 after page 1 in Latest Micrsoft Edge Chromium .

 

It prints for first time and later i have to reload the report to print smae page or any other page in report

 

powerbi-client v2.7.3. we tried latest power bi client js also

 

var element = $('#' + containerID)[0];
var report = powerbi.get(element);
report.print();

 

Regards,

Manoj Kumar G

2 Replies

  • v-cazheng-msft's avatar
    v-cazheng-msft
    Community Support

    Hi mganji 

    It maybe caused by these reasons in this article Troubleshoot print issues in Microsoft Edge. Can you see the successful response of the Power BI Service server to the request in the console of the Edge browser? If you didn't get correct response, it probably the issue with the Server side. Otherwise, the remaining reasons.

     

    Best Regards

    Caiyun Zheng

     

    Is that the answer you're looking for? If this post helps, then please consider Accept it as the solution to help the other members find it more quickly.

     

     

  • mganji's avatar
    mganji
    Regular Visitor

    Below is the root cause i could understand by debugging the code. But couldn't find any fix

     

    Chrome:

    1st

    Invocation to print()-->Preview apprears -->User Prints-->Response appears

     

    2nd

    Invocation to print()-->Preview apprears -->User Prints-->Response appears

     

    Edge

    1st

    Invocation to print()-->Preview apprears -->User Prints-->Response appears

     

    2nd

    Invocation to print()-->Response appears

    No preview appears and direct response is captured

     

     

    Report.prototype.print = function () {
    return this.service.hpm.post('/report/print', null, { uid: this.config.uniqueId }, this.iframe.contentWindow)
    .then(function (response) {
    return response.body;
    })
    .catch(function (response) {
    throw response.body;
    });
    };