Click here to Skip to main content
15,867,686 members
Articles / Programming Languages / C++

Displaying a SharePoint List from another team site in Sharepoint Foundation 2010

Rate me:
Please Sign up or sign in to vote.
4.67/5 (6 votes)
17 Jul 2010CPOL4 min read 123.9K   7   17
I remember I was using MOSS before and this is possible by using by connecting to another library like how it was disucssed in this blog http://sharepointgeorge.com/2009/display-sharepoint-list-site-data-view-web-part/, but now I had changed jobs and I am implementing the free version first whi

I remember I was using MOSS before and this is possible by using by connecting to another library like how it was disucssed in this blog http://sharepointgeorge.com/2009/display-sharepoint-list-site-data-view-web-part/, but now I had changed jobs and I am implementing the free version first which is the Sharepoint Foundation 2010 which have lesser functionalities than MOSS and one of it is displaying a SharePoint List from another team site.

The Sharepoint Foundation is locked down to display list data sources from the same team site but thanks to the Sharepoint webservices there is a way of doing it.

By default sharepoint have a suite of webservices available and these are the ones that are available

  • http://ServerName:99999/_vti_adm/Admin.asmx – used for creating and deleting sites, change 99999 with your administrative port number
  • http://ServerName/_vti_bin/Alerts.asmx – used for working with alerts
  • http://ServerName/_vti_bin/DspSts.asmx – used for retrieving schemas and data
  • http://ServerName/_vti_bin/DWS.asmx – used for working with Document Workspaces
  • http://ServerName/_vti_bin/Forms.asmx – used for working with user interface forms
  • http://ServerName/_vti_bin/Imaging.asmx – used for working with picture libraries
  • http://ServerName/_vti_bin/Lists.asmx – used for working with lists
  • http://ServerName/_vti_bin/Meetings.asmx – used for working with Meeting Workspaces
  • http://ServerName/_vti_bin/Permissions.asmx – used for working with SharePoint Services security
  • http://ServerName/_vti_bin/SiteData.asmx – used by Windows SharePoint Portal ServerName
  • http://ServerName/_vti_bin/Sites.asmx – used to retrieve site templates
  • http://ServerName/_vti_bin/UserGroup.asmx – used for working with users and groups
  • http://ServerName/_vti_bin/versions.asmx – used for working with file versions
  • http://ServerName/_vti_bin/Views.asmx – used for working with views of lists
  • http://ServerName/_vti_bin/WebPartPages.asmx – used for working with Web Parts
  • http://ServerName/_vti_bin/Webs.asmx – used for working with sites and subsites

Now what we need here for this sample is the http://ServerName/_vti_bin/Lists.asmx.

Also in my sample I had created a filtered list so that anything that is ticked “publish to root” will be the only ones displayed on the list you want to compile.

This is a good way of separating your team site with the public site access, thus making the management of your announcements in one location and preventing giving access to users on your team site.

Note:  Thats is not a built in column and you have to manually create it.

Now from there you can now create your filtered list, here is the step by step process.

1. Go to List Settings

2. Go to the bottom of the page and click on create view

3. Choose standard view

4. Filter it according to the “publish to root” flag

5. Now your view is ready, click on it to view its List and View ID.

Take note of this and replace the characters “%2D” with “-”  so on this sample the List ID which is shown as 58a8179c%2Da062%2D4dec%2D9569%2D4f0d5518ebf8 will be 58a8179c-a062-4dec-9569-4f0d5518ebf8 and do that as well for the View ID.  Take note of this as you will be using this ID’s later

Now your everything is set up interms of your list data source, you need to now create your data source on Sharepoint Designer.  Fire up Sharepoint Designer and connect to your team site.

Now go to Data Sources and click SOAP Service Connection, then you can now define your Data Source.

Service location : /_vti_bin/Lists.asmx
Data Command : Select
Port : ListsSoap
Operation : GetListItems
Parameters : You need to fill up only listname and viewname and this is the one you had taken note a while ago.


Now go to General tab and give it a Name

And define Security Context on the Login Tab. Note: This is important as they security user that you will assign here should have access to the specific list thats why we havent used the Windows Authentication as it defeats the purpose of the one I discussed above (the two level announcement publishing) or you dont want to manage each users access to have view on specific List View.

Now go to any page you want to place your data view by clicking data view and choose your created SOAP Services Data Source.

Now the list will now show on the page but you still have to clean it up as it will be in its raw form, like title will have “ows_” prefix on it, the Body is formatted to text (you can format it to rich text like the one below), the author have some extra characters that you need to clean as well (you can do it by modifying the field to <xsl:value-of select=”substring-after(@ows_Author, ‘#’)” />, so it removes that extra characters).


Now you have it!

Another trick that I can share is that you can also merge different list you want to publish for example from multiple private team sites into the root sharepoint site by using the linked data source and choose any list you want to merge and join together into one data source.


License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Technical Lead
New Zealand New Zealand
http://nz.linkedin.com/in/macaalay
http://macaalay.com/

Comments and Discussions

 
Questionproblem with get data on page Pin
Member 405964813-Oct-14 0:31
Member 405964813-Oct-14 0:31 
AnswerRe: problem with get data on page Pin
Member 405964813-Oct-14 1:03
Member 405964813-Oct-14 1:03 
GeneralRe: problem with get data on page Pin
Member 405964813-Oct-14 3:16
Member 405964813-Oct-14 3:16 
QuestionQuery data from the other site Pin
Member 1091310529-Jun-14 17:19
Member 1091310529-Jun-14 17:19 
QuestionMERCI BEAUCOUP! Pin
whoajack31-Dec-12 4:27
whoajack31-Dec-12 4:27 
QuestionData form not appaire Pin
Member 437191525-May-12 4:19
Member 437191525-May-12 4:19 
QuestionTrying to view data that is on a subsite Pin
michellekorb10-Feb-12 13:04
michellekorb10-Feb-12 13:04 
QuestionData View Format Pin
svaa27-Jan-12 4:11
svaa27-Jan-12 4:11 
AnswerRe: Data View Format Pin
svaa27-Jan-12 5:06
svaa27-Jan-12 5:06 
QuestionLogin Pin
svaa26-Jan-12 7:41
svaa26-Jan-12 7:41 
AnswerRe: Login Pin
Raymund Macaalay26-Jan-12 8:24
Raymund Macaalay26-Jan-12 8:24 
*Don't attempt to authenticate
- As the name says this will not authenticate, this will be used if anonymous access is enabled on your data source
*Save this username and password in the data connection
- It will log in using this username on your datasource
*Use Windows authentication
- This will use the current credentials of the user on the data source, there can be issues here if you have a multiple hop authentication, you need kerberos enabled if using this
GeneralRe: Login Pin
svaa27-Jan-12 4:10
svaa27-Jan-12 4:10 
GeneralMy vote of 5 Pin
TheLawz18-Jan-12 7:00
TheLawz18-Jan-12 7:00 
QuestionDisplay User Picture Pin
Bruno Okamoto23-Nov-11 2:13
Bruno Okamoto23-Nov-11 2:13 
AnswerRe: Display User Picture Pin
Raymund Macaalay23-Nov-11 8:47
Raymund Macaalay23-Nov-11 8:47 
QuestionDisplay a Survey and insert answers Pin
Bruno Okamoto27-Oct-11 7:01
Bruno Okamoto27-Oct-11 7:01 
AnswerRe: Display a Survey and insert answers Pin
Bruno Okamoto27-Oct-11 7:02
Bruno Okamoto27-Oct-11 7:02 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.