I have been playing with the SharePoint Client Object Model today and have been able to connect to my department's SharePoint site and list items (SSRS reports) found within a specific library using the follow code in a console app:
ClientContext ctx = new ClientContext("http://sitename.ca");
List lst = ctx.Web.Lists.GetByTitle("Departmentals");
CamlQuery cq = CamlQuery.CreateAllItemsQuery();
ListItemCollection lic = lst.GetItems(cq);
ctx.Load(lic, items => items.IncludeWithDefaultProperties(item => item["Report_x0020_Description"], item => item.DisplayName));
ctx.ExecuteQuery();
foreach (ListItem l in lic)
{
Console.WriteLine(l.DisplayName + ": " + l["Report_x0020_Description"]);
}
Console.ReadLine();
This code lists all SSRS reports and the custom description field but I can not figure out how to access things other than "columns" in my SharePoint list from the item. Can anyone point me in the direction of how to access the datasource attached to an ssrs report? In particular I need to determine if it is using a shared datasource or a custom datasource and list the username stored within the datasource if it is a custom one. Any help apreciated, thanks.