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
November 2022 Update

Check it Out!

Click here to read more about the November 2022 updates!

Difinity Conference

Difinity Conference 2022

Difinity is the largest Microsoft Data, AI, Power BI, Power Platform and Business Applications Conference in New Zealand.

European Share Point Conference

European Share Point Conference

This conference returns live and in-person in Copenhagen this 28 November-01 December with 4 Microsoft Keynotes, 9 Tutorials, and 120 Sessions.

Microsoft 365 Conference â__ December 6-8, 2022

Microsoft 365 Conference - 06-08 December

Join us in Las Vegas to experience community, incredible learning opportunities, and connections that will help grow skills, know-how, and more.