In the SharePoint 2010 sites users will be able to export the custom list items to excel using the export to excel option in ribbon toolbar. It will export all the items in that particular view in which the option is invoked. SharePoint literally is not exporting the items it creates iqy query file instead, which will have the view id and helps to query the SharePoint list data and the results are shown in the excel spreadsheet.
Now if I have a requirement something like, I need to export only specific items from the list. Let's say I want to export only 10 items out of 30 items shown in the view then there is no direct option for that. I need to create a view and apply filter to extract only the specific 10 items which I want to export. But I can' t create views every time to export any specific items. What if I don't have appropriate permissions to create views? To overcome these kind of issues, I have created a component which will export the specific items from the custom list. Its a custom action which will create the "Export to excel" ribbon button. Just selected the items and click on the button in the ribbon to export the items.
Demo Video
Update
You can download and read about the latest release over here http://rjesh.com/2012/10/export-selected-items-to-excel-release.html
Now if I have a requirement something like, I need to export only specific items from the list. Let's say I want to export only 10 items out of 30 items shown in the view then there is no direct option for that. I need to create a view and apply filter to extract only the specific 10 items which I want to export. But I can' t create views every time to export any specific items. What if I don't have appropriate permissions to create views? To overcome these kind of issues, I have created a component which will export the specific items from the custom list. Its a custom action which will create the "Export to excel" ribbon button. Just selected the items and click on the button in the ribbon to export the items.
How to
- Deploy the Rjesh.Solutions.wsp to the concerned web application
- Go to site features and activate the feature "Export Selected Items to Excel"
- Use the export functionality in the custom list
Demo Video
Download
You can download the WSP and code from here
Update
You can download and read about the latest release over here http://rjesh.com/2012/10/export-selected-items-to-excel-release.html

how to remoave id;# from lookup column or personal or group
ReplyDeletehi can you please send me a wsp file to my mail id, since i do not have permission to download anything from here. please help me.
ReplyDelete@ramanjulu, please share your email id.
ReplyDeleteHi Rajesh,
ReplyDeleteThanks a lot for your quick reply. at last i have deployed the solution and activated the feature, but i do not see the icon(ExportToExcel) in the ribbon. i have checked 14\images\ExcelIcon.png is also available. Can you please guide me what could be the reason. this is my mail id: "ramanjulu.n@isgn.com"
@ramanjulu,the button will be shown in the items tab in the custom list ribbon. If the feature was properly activated. About the image you should check inside the \Images\Rjesh.Solutions\ folder structure in the 14 hive. Hope this helps.
ReplyDeleteHi Rajesh,
ReplyDeleteI need this button to be displayed in the document library(library category can be anything). can this be done? Please suggest.
hi rajesh,
ReplyDeletethis feature is available for document library or can we assign this feature to doument library in the coding itself. if yes, please help me how to do this.
@Ramanjulu, you can make it work for the document library with some changes to the ExportSelectedItems element.xml.
ReplyDelete1. Change the registration ID to 101 - which will set it for document library
2. Change the CustomUI Defintion where you want to show the button in the Document library ribbon.
If time permits I will post a blog with the screenshots. Happy coding
Thank you so.........much Rajesh, i have succeeded by doing so. but there is a problem in exporting. I have two "lookup" columns. when i export the list items(selected or all) to excel, these two lookup columns not exporting exactly what is there in the list. lets say i have "Vendor" in one lookup column, after exporting it will be "2;#Vendor". so i want to see only Vendor not the symbols and numbers. i do not know from where it is capturing numbers and symbols. other list column has "Cordy, Inc", in excel "1009;#Cordy, Inc". please guide me.
ReplyDeleteIts fixed in the Release 1.1.0 along with the other issues. You can download the latest 1.1.0 WSP from here http://bit.ly/V69LMt
ReplyDelete@Rajesh, good job!
ReplyDeleteTrying to change the project to export all of the list items. I got it working in a Standard View, but the code breaks in Datasheet View. What updates need to be made to the .js file?
@Lisa, Thanks for the comments.
ReplyDeleteThis components has been designed for the standard view. In the data sheet view, the client object model's getSelectedItems api won't work. I'll disable (gray out) the export button in the ribbon like other out of the box controls. Mean while I look for alternatives to achieve this in Data sheet view. Please subscribe through Facebook/Feeds for the updates.
Hey Rajesh, this is a great solution. But I have one question. Can I export the entire view with this feature and not only the selected items? I have a problem with the default "Export to Excel" button, so I am trying to do this with your solution.
ReplyDeleteThanks, Boris
@Boris, you can use the select all and export all the items in the page using this feature. It won't export all the items in the view. The contents in the might be folded in multiple pages with the pagination. This feature can export the items in that particular page only.
ReplyDeleteHi Rajesh,
ReplyDeleteI notice that this only works to items in a list directory. How can I export items that are inside a site page. Thanks!
Hey Rajesh, this is a great solution. But I have one question. The export hungs as soon as I select an item that has a value in a managed metadata column? Can you help me?
ReplyDeleteThanks, Roland
@Roland which version are you using? Can you try the 1.1.0 version?
ReplyDeleteHi Rajesh,
ReplyDeleteYes I have downloaded the 1.1.0 version and I did modify the code so that I can use on different type of tables. I will start debuging the code but i just wanted to know if you had the same issue.
Thanks
Roland
It's fixed in the latest version 1.1.0. So your debugging should help.
DeleteIt doesn't work in record center site library
ReplyDeleteNever tried with record center, good catch. will fix it soon.
DeleteI tried with the records center - Drop Off Library. I don't see any issues in that. Make sure that the feature is activated at the record center site level. Give some more details on the error you get.
DeleteHi Rajesh!
ReplyDeleteGreat solution thank you so much, it help me alot.
Hope this solution will eventually support some metadata fields.
God Bless.
Thanks for the appreciation. Metadata field issue is fixed in the Release 1.2.0.
DeleteHi Rajesh, great work, just came across your solution, unfortunately also doesnt work with a forms library , can you post the code somewhere so i can see what the problem may be ? thanks
ReplyDeleteThanks for the appreciation. Forms library issue is fixed in the Release 1.2.0.
DeleteHi Rajesh,
ReplyDeletecan you please make available latest version in Codeplex, i didn't find any downloads for the latest version.
and thanks for the wonderful solution.
Thanks,
JK
Hi Rajesh,
ReplyDeletegreat solution, but I have a problem - it doesn't work in IE8.
When I try to export I have a message "Web site not found".
What can be the metter?
Hi Rajesh,
ReplyDeleteThe great solution for Sharepoint world. Can you please send me the source code of latest version, please? shilabhadra@live.in