SharePoint provides types and members in the Microsoft.SharePoint.Client namespace for accessing SharePoint remotely from a client computer or server. To get started with SharePoint client object model you will need Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime assemblies. You can copy these DLLs from the %ProgramFiles%\Common Files\Microsoft Shared\web server extensions\14\ISAPI folder of the server that runs Microsoft SharePoint Foundation 2010.
Using the Microsoft.SharePoint.Client types you can get access to SharePoint List data. However in order to have design time support (Telerik Reporting Data Explorer, Wizards and Expression editor) with SharePoint as data source, you will need the following SharePointDataSource helper class. This class manages the SharePoint credentials, list schema and data retrieval. Just add the SharePointDataSource class to you project and build it. Then you can use it in Telerik Reporting ObjectDataSource as DataSource type and GetListData method as DataMember. The GetListData() method is parametrized with the required SharePoint credentials, List name and SharePoint URL thus you can directly set them in the ObjectDataSource wizard.
Check out SharePointDataSource.zip sample project that illustrates the suggested approach. In order to run it you have to reference the Microsoft.SharePoint.Client and Microsoft.SharePoint.Client.Runtime assemblies. Additionally you have to update the ObjectDataSource parameters with your SharePoint URL, credentials and list name.
Petar Raykov is a Software Developer in the Telerik Reporting division. He has been working on Telerik products since 2010. Off work he enjoys traveling, hanging out with friends and reading.
Subscribe to be the first to get our expert-written articles and tutorials for developers!