cancel
Showing results for 
Search instead for 
Did you mean: 
Reply
sorcerorkazin
New Member

Serving PDFs From Report

Hello,

 

I have searched all I could and probably I missed something somewhere. To put it simply, what I am trying to achieve is to allow the user to search for documents based on a few columns from an SQL Server (2019 if it matters), give a preview for the PDF, and allow the user to download that PDF.

 

Long version

 

We have an SQL Server that contains contract information and we save the PDFs as a column in a table. I want to be able to create a way for users to search for the document and be able to download it as well. I was able to do two of the three things I want to do. I was able to create the report to allow the user to filter out information in order to locate the report, I was able to use a custom visual PDFViewer to allow the user to preview the PDF, but it seems that there is no "save" function on this custom visual. I thought about doing it using base64 and an HTML custom visual, however in my attempts they either display the encoded file in what appears to be something like an iframe (using HTML Content custom visual) or the error message "Link is malformed" will be thrown (using Shielded HTML Viewer). I know what you are thinking, maybe create a web server to accept a request say with a primary key id in the URL, but the thing is with the way the DoD is going in making everything work from the cloud, they are being more strict in approving on premise servers. I want to first exhaust all options before going through the loops to get a webserver approved. Please let me know if Power BI has no way of doing this, I wouldn't mind. Like I said we can do the webserver solution, but it is my last resort. 

1 ACCEPTED SOLUTION
josef78
Super User
Super User

Your PDF's are stored in DB as blob?

 

I think, there no built-in Power BI function to render PDF.

 

You can try (re)develop custom visual as PDF viewer, with Save as option.

 

But much more easily, you can develop very simple web aspx page, which will serve document based on URL link (with some Id or token) from connected DB. But for it you will need some IIS server (or another technology), which you can host on Azure cloud.

View solution in original post

1 REPLY 1
josef78
Super User
Super User

Your PDF's are stored in DB as blob?

 

I think, there no built-in Power BI function to render PDF.

 

You can try (re)develop custom visual as PDF viewer, with Save as option.

 

But much more easily, you can develop very simple web aspx page, which will serve document based on URL link (with some Id or token) from connected DB. But for it you will need some IIS server (or another technology), which you can host on Azure cloud.

Helpful resources

Announcements
Carousel_PBI_Wave1

2023 Release Wave 1 Plans

Power BI release plans for 2023 release wave 1 describes all new features releasing from April 2023 through September 2023.

Power BI Summit Carousel 2

Global Power BI Training

Make sure you register today for the Power BI Summit 2023. Don't miss all of the great sessions and speakers!

BizApps LATAM 2023

Business Application LATAM Summit 2023

Join the biggest FREE Business Applications Event in LATAM this February.

Power Platform Bootcamp

Global Power Platform Bootcamp

In this bootcamp we will deep-dive into Microsoft’s Power Platform stack with hands-on sessions and labs, delivered to you by experts and community leaders.