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

3

6

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?

Elboa answered 21/4, 2018 at 14:37 Comment(1)
I would like to know the same actually :)Ludovika
N
1

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/

Nuli answered 12/5, 2020 at 12:57 Comment(0)
U
0

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

Uppermost answered 12/7, 2019 at 20:2 Comment(0)
M
-1

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.

Massarelli answered 2/4, 2019 at 9:59 Comment(4)
Thanks Pratik, but this print solution is not working for my case as it dosen't print the complete power bi report.Elboa
@VishnuChandel what does it print?Massarelli
It prints half of the report as my report is very wide in size.Elboa
@VishnuChandel I think you can find how to manage that here: microsoft.github.io/PowerBI-JavaScript/demo/v2-demo/index.html#Massarelli

© 2022 - 2024 — McMap. All rights reserved.