As part of the current project I’m working on, I needed to create a data view which passed a querystring parameter into a data view web part to display filtered data. The idea was to export this data to Excel using the export feature on the office ribbon available on SharePoint 2010.
To create the the view and apply the filter was very simple. I used SharePoint designer 2010, created a new web part page and inserted a data view. I re-arranged my columns and then applied the Query string parameter filter to the view. When I tested the view, it worked nicely. So the next step was to export the data to excel. This didn’t seem to work… so I was left scratching my head…
<button onclick=”exportToExcel();”>Export to Excel File</button>
To find the table Id click here
So this worked, but there is a few gotchas:
- This will only work in when using IE
- You will need to set your browser to Allow Active X controls
- You will need to have Excel on your machine 😉
Thanks to the guys on MS SharePoint forums!!