简体   繁体   中英

How to export power bi embedded report to pdf using mvc c#

I have embedded a power bi online report into my MVC C# application and its rendering properly. Further I am trying to export it into PDF, but didn't find a way to do it. I have tried jsPDF and Cavas2html, but that didn't work. Is there any possibility to do it using any other tools?

Microsoft just released the functionality we're looking for! Apparrently we can call a power bi report and export it as a PDF programmatically. https://powerbi.microsoft.com/en-us/blog/export-report-to-pdf-pptx-and-png-files-using-power-bi-rest-api/

I know its pretty late now, but can just try printing it:

// Get a reference to the embedded report HTML element
var embedContainer = $('#embedContainer')[0];

// Get a reference to the embedded report.
report = powerbi.get(embedContainer);

// Trigger the print dialog for your browser.
report.print()
    .catch(function (errors) {
        Log.log(errors);
    });

Let me know if it helps.

You cannot achieve this without a hacky solution as of July 2019. Printing and exporting as pdf/ptt etc. from Power BI embedding is currently rather limited.

There is a feature request for exporting as pdf here with over 400 votes. If this is a feature you want I suggest voting for it: https://ideas.powerbi.com/forums/265200-power-bi-ideas/suggestions/35066698-export-to-pdf-via-power-bi-embedded-api#comments

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM