SharePoint Modern View not Opening PDFs from Data View Web Part RRS feed

  • Question

  • Can't seem to find the right forum to place this in as it does not include SharePoint Online, but the Microsoft Community forums sent me here as they thought users here will have a better idea of what is going on.

    I have many data view web parts on a SharePoint site. These generate lists of documents from multiple document libraries based on common meta data. The links on the lists worked fine up until December. This issue now is that the sites are using the modern PDF viewer.

    The links that are generated use "action=default" to open the file. The Microsoft file types (word, etc.) are handled fine and open correctly. The PDF links now only take you to the folder where the file sits.

    I have tried Microsoft support to see if I could force the classic method of opening a PDF but they have told me it is not possible.

    So I have to rework my code in SharePoint Designer to match the URLs created by SharePoint to open PDFs.

    1. What is the new format for the link? (i.e. what info do I need to build the link and what is the formula)

    2. How can I get the code to check whether the file type is PDF or not and build the URL respectively?

    Thanks in Advance!

    Sunday, March 18, 2018 10:25 PM

All replies

  • Hi SikwoodDude, 

    Do you mean that you cannot open PDFs from Data View Web Part in modern view?

    Can you open PDFs from Data View Web Part in calssic view?

    Best Regards, 

    Lisa Chen 

    Please remember to mark the replies as answers if they helped. If you have feedback for TechNet Subscriber Support, contact

    Click here to learn more. Visit the dedicated forum to share, explore and talk to experts about Microsoft Teams.

    Monday, March 19, 2018 12:06 PM
  • Hi Lisa,

    The web part is sitting on a classic page as (as far as I am aware) I cannot open the modern pages in sharepoint designer to configure the web part. The PDFs try to open in the modern PDF view, probably because the site uses the modern view by default.

    Essentially, it seems that the way PDFs are handled has been changed, and I can't use the same link structure that I use for Microsoft documents.

    I hope my explanation is clear and thank you for your help.

    Friday, March 23, 2018 12:18 AM