Article
14 comments

Exporting XSLT List View Web Part using SharePoint Designer

Imaging the following situation where you want to export an XSLT List View web part and embed it on a different site. So the good thing about this it’s easy to accomplish. I came across a great article posted by Glyn on his blog how to export an xslt viewer web part. He shows in his article some really great insight how the xslt viewer web part can be exported. The only thing he left out is that you can export XSLT List View web parts using SharePoint Designer. This feature is really well hidden in the ribbon.

In SharePoint Designer simply select the XSLT List View web part you want to export. In the Ribbon you will find a specific menu for this web part. Ribbon for the web part comes up you can select inside the “Web Part” Tab. In the far right area of the ribbon you will find two really helpful menus.

Well hidden export feature on the right side

The “To Site Gallery” option will copy the web part to your site collection web part gallery. You will also be asked how you want to name your web part, description and you will be able to change properties.

XSLT List Viewer Export Options

Another option to select is if you want to use it relative to any site where the web part will be embedded or get data only from the current site.

Web specific settings for export

The “To File” option will open the download dialog to store the web part and the configuration to a file.

As you see it’s easy to export a XSLT list view web part and use it the way you like. You can also cross embed lists from one web into another.

14 Comments

  1. Firstly, thanks for your post! I have followed above steps but there were some issues. I’ve got a XSLT list view webpart and it’s customized through CALM query (by filter) and xsl code. No problem when I export this webpart to file .webpart and to webpart gallery as well. But in both 2 cases I did, imported webpart was not showed as original webpart.
    I’ve checked code webpart in the page and I found that the CALM query and some properties were modified.

    30

    Please show me what I should do to fix this problem?
    Thanks in advance!

    Reply

    • Hi,
      hard to say without code or screenshots. Can you please be more specific ?

      kind regards
      Stefan

      Reply

  2. Hi,

    Thank you for the post!

    Is there a way to use a Query String Filter with the exported web part ?

    Thanks!

    Reply

  3. Hi Stefan,

    I tried doing the first method and inserted the web part to a different page and received the following error upon saving:
    “Error Rendering Control
    An unhandled exception has occurred.
    Cannot instantiate type ‘ErrorWebPart’ because it is not public.

    Can you help me figure this out?

    Appreciate it.

    Reply

    • Which kind of SharePoint you are on? If you use SharePoint 2013 you have to make sure that the list view renders in classic view.
      Haven’t use this method for a long time. The last i did was in 2010.
      /Stefan

      Reply

      • 4 months too late, but any chance you can tell me how to make sure the list view renders in classic view? 2013 got rid of Design View of course and it’s ruining my life. All I can see is Code. Any suggestions??

        Reply

        • Edit the web part page in your browser. Just select the gear icon in the right side of the header and choose ‘Edit Page’. Then you can edit the web part properties. In those properties you will find a check box that says ‘Server Render’. If you select this and hit the apply and ok button you will see the web part renderering in the old classic view.

          So SharePoint Designer needed for this task.

          Reply

  4. Hi Stefan,
    Thank you for the post! I am encountering some problems. so I saved my view from SPD selecting the To File option, so I can use it to display in another site, However when I upload the file and try to load it gives me the error “List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user.”. Also I am never prompted if I want to use it relative to any site where the web part will be embedded or get data only from the current site. It just saves the file. Any help? Thank you!

    Reply

    • Sadly this hint only works partially with SharePoint 2013/2016. You should check if you are able to apply proper List and Web Ids in the webpart xml directly.

      Reply

Leave a Reply

Required fields are marked *.


This site uses Akismet to reduce spam. Learn how your comment data is processed.