Home > Forum > General > Document viewer

Document viewer
0

Hi,

I am currently exploring options for viewing documents within Webcon. Specifically, I am interested in understanding whether there is a possibility to visualize a document by providing a link that points to a document stored either on SharePoint or within a SQL Server database.
My goal is to enable the automatic display of the associated document in preview mode when a user selects a record in the application.

Has anyone had experience or insights into achieving this integration? If so, could you please share any guidance, tips, or recommended approaches to enable document viewing through Webcon using links from SharePoint or a SQL Server database?

Thank you.

MVP

Hi Maria,

SharePoint only
If these documents can be displayed in SharePoint for example Word documents, I would check the URL and see whether you could use this URL as the source of an iFrame. If this is possible, there may be security restrictions and I have no idea, whether you can change them, you could modify dynamic parts of the URL to display the document.
This would be my first approach.

SDK approach
The SDK contains the CustomFilesManager. This allows you to upload a document to the database with an expiration date.
https://developer.webcon.com/2023/resources/sdk-reference/html/649e50c9-cc91-c965-fe85-5f53acd6fce3.htm
Afterwards you can call GetUrl with FileViewMode preview
https://developer.webcon.com/2023/resources/sdk-reference/html/685edde9-a355-439d-853a-bde039972231.htm

I have used this for testing purposes ones in the past. I suspect that all file types are supported, which can currently displayed in preview. This approach could work for SharePoint and SQL. But it's an overhead and for SharePoint I would test the previous one first.

Best regards,
Daniel

MVP
In reply to: MariaM

I have tried using an HTML form field and it is not working. It says "company.sharepoint.com refused to connect".

Is there a possibilty to create a sdk form field that may offer a preview?

Hi Maria,

the problem here is, that SharePoint Online doesn't allow to be hosted /embedded on all websites (domains). These need to be whitelisted. It won't make a difference how the iFrame would be added.
By the way, the same applies to WEBCON BPS too.

While I know that you can set these using the Content-Security-Policy in WEBCON I have no idea how to set them in SharePoint Online.
https://docs.webcon.com/docs/2023R3/Studio/SystemSettings/GlobalParams/SystemSettings_Security#2-custom-response-headers

Maybe you find something online if you search for Content-Security-Policy. I didn't find a solution only questions like these:
https://learn.microsoft.com/en-us/answers/questions/1461315/embed-sharepoint-online-site-page-into-iframe

Best regards,
Daniel