Ads

Wednesday, 3 April 2013

Creating a Export to Excel link in SharePoint

When we open a document library or a list AllItems.aspx we have an option to export the data into spreadsheet. However there is no direct link given. However, when you want to place a link for Export to excel in your web part or your webpage, then here is a way to go for it.

{siteurl}/_vti_bin/owssvr.dll?CS=109&Using=_layouts/query.iqy&List={GUID of list}&View={GUID of view}&CacheControl=1

As you can see all you need to do is replace the respective place holders.

           {siteurl} is your site url.
           {GUID of list} is the GUID of the list for which you want to export the data to spreadsheet. 
           {GUID of view} is the GUID of the view which you want to export the data to spreadsheet.

Where will you get these GUIDs? Well, you will find it when you click on List Settings.



And then click on the view name for which you want the data





No comments:

Post a Comment

Ads