none
Widget collecting datas from sharepoint RRS feed

  • Question

  • Hello,

    I need your help as I'm very new on sharepoint and I would like advice.

    I need to code a widget which show up informations coming from sharepoint database.

    How can I do that?

    Thanks for your help,

    Tuesday, March 27, 2012 2:47 PM

All replies

  • Hi,

    Would you please clarify a few things;

    Are you looking to get data from SharePoint and display on another platform (e.g. show data from a SharePoint list on another web site), or are you looking to create your own Web Part (what you call Widget) in SharePoint?

    If you're just looking to get data out of SharePoint remotely, you can use the Web Services, REST or my favorite: the Client Object Model.


    Tobias Zimmergren
    Microsoft MCP, MCTS, MCT, MVP (SharePoint)
    Blog: www.zimmergren.net
    Twitter: twitter.com/zimmergren
    Corporate site: www.tozit.com

    Wednesday, March 28, 2012 1:18 PM
  • Hi,

    I actually want to collect values from a list in sharepoint by WPF and create a "windows gadget" showing this list, changing every hours or day.

    So I created my wpf project. and this is below my page which collect values in the sharepoint site by Clients Object Model.

    Now I need to show it in my page.xaml but im not very popular with WPF yet.

    thanks for your help

        public partial class Page1 : Page
        {
            public Page1()
            {
                string siteUrl = "http://site/SandBox";
                ClientContext clientContext = new ClientContext(siteUrl);
                SP.List oList = clientContext.Web.Lists.GetByTitle("Tips");
                CamlQuery camlQuery = new CamlQuery();
                camlQuery.ViewXml = "<View><RowLimit>100</RowLimit></View>";
                Microsoft.SharePoint.Client.ListItemCollection collListItem = oList.GetItems(camlQuery);
                clientContext.Load(collListItem,
                     items => items.Include(
                        item => item.Id,
                        item => item.DisplayName,
                        item => item.HasUniqueRoleAssignments));
                clientContext.ExecuteQuery();
                foreach (Microsoft.SharePoint.Client.ListItem oListItem in collListItem)
                {
                    Console.WriteLine("ID: {0} \nDisplay name: {1} \nUnique role assignments: {2}",
                        oListItem.Id, oListItem.DisplayName, oListItem.HasUniqueRoleAssignments);
                   
                }
            }
        }
    }

    Wednesday, March 28, 2012 2:23 PM
  • Hi,

    I did use the client model object also, but Im not sure how to use it with the WPF to create the windows gadget.

    Ive added my code in the Page1.xaml.cs but ive an error now. (ive checked my sharepoint client dll are well references), i've added

    using Microsoft.SharePoint.Client;
    using SP = Microsoft.SharePoint.Client;

    But when I run my wpf app i've got >

    "An unhandled exception of type 'System.Windows.Markup.XamlParseException' occurred in Unknown Module.

    Additional information: Cannot create instance of 'Page1' defined in assembly 'TipsList, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null'. Exception has been thrown by the target of an invocation.  Error in markup file 'Page1.xaml' Line 1 Position 7."

    Thanks for your help

    Wednesday, April 4, 2012 2:57 PM
  • Hi SunnyShiny06,

    For displaying SharePoint data in custom WPF application, here are some tutorials about this, please refer to it for more information:
    Integrate SharePoint list data in your wpf application:
    http://blogs.msdn.com/b/vsdata/archive/2009/11/26/integrate-sharepoint-list-data-in-your-wpf-application.aspx
    Customize Data Display with Data Binding and WPF:
    http://msdn.microsoft.com/en-us/magazine/cc700358.aspx

    Also, for the WPF issue, people in the WPF forum are more professional about this, you can also go to that forum for more information:
    Windows Presentation foundation(WPF):
    http://social.msdn.microsoft.com/Forums/en/wpf/threads

    Thanks,
    Qiao


    Qiao Wei

    TechNet Community Support

    Monday, April 9, 2012 9:55 AM
    Moderator