Click here to Skip to main content
Click here to Skip to main content

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

By , 17 Jul 2010
 

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)

About the Author

Raymund Macaalay
Technical Lead
New Zealand New Zealand
Member
http://nz.linkedin.com/in/macaalay
http://anyrest.wordpress.com/

Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board.
Search this forum  
    Spacing  Noise  Layout  Per page   
QuestionMERCI BEAUCOUP!memberwhoajack31 Dec '12 - 4:27 
This is great suggestion, opens a lot of doors and flexibility. Just tested it out and it works very nicely. Wish I stumbled across this a long time ago :P
I'm a tool.

QuestionData form not appairememberMember 437191525 May '12 - 4:19 
hi,
 
when i choose data source, there is no data form paired
 
Why ?
 
Thk
QuestionTrying to view data that is on a subsitemembermichellekorb10 Feb '12 - 13:04 
Hello,
 
I am trying to insert a data view on the parent site....i want to view list data that is on one of its subsites. Can I do this?
 
Where do I set up the data source? On the subsite or on the parent site?
 
Or does this only work when tring to get data from another subsite within the same parent?
 
Thanks so much for your help!
michelle
QuestionData View Formatmembersvaa27 Jan '12 - 4:11 
When I insert my Linked Data Source into Data View. The Design/display in the data view is differnt from the origninal lists.
 
For example. One of the columns is "Facility". In the original list the facility is listed as "Perth Amboy", however in the data view it shows up as "23#;Perth Amboy". How can I fix this. (I tried deleting just the "23#" it deletes the entire word.
 
Also, one other column is "Pallets On Hand". The entry for this column (for example) is 100, it shows up as float;#100.0000000
 
Please advise on how I can fix these errors.
 

Thank you!!
AnswerRe: Data View Formatmembersvaa27 Jan '12 - 5:06 
I also noticed that these errored fields are either calculation or a lookup on the original list.
 
Please advise. Thanks.
QuestionLoginmembersvaa26 Jan '12 - 7:41 
I was recently introduced to SharePoint. I am developing a sharepoint collection, so there is a lot of self-teaching involved. I would appreciate if you can explain the three options in the Login tab of the Data Source Properties.
*Don't attempt to authenticate
*Save this username and password in the data connection
*Use Windos authentication
 
Thank you.
AnswerRe: LoginmemberRaymund 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: Loginmembersvaa27 Jan '12 - 4:10 
Thanks.
GeneralMy vote of 5memberTheLawz18 Jan '12 - 7:00 
Great Post. Exactly to the point. Was unable to get rid of the extra characters associated with the @author field. Tried editing it in the xpath editor...but kept blowing up. Used your example to type it in via code view and worked. You rock !!
QuestionDisplay User PicturememberBruno Okamoto23 Nov '11 - 2:13 
Hi,
 
Me again Poke tongue | ;-P
 
I'm now trying to display a list from a subsite at the root (followed your article and it's working. thx!).
 
It's displaying the author's name , but I also would like to display the picture.
 
With the help of this article Displaying a user’s picture in the data view web part I managed to display the author's pictures on the subsite.
 
Is it possible to also display the picture through soap services? As far as I could see, the Soap Service only returns ows_Author, apparently as String and not as Person (object). Do you know if it's possible by changing the configs of the list or the soap connection?
 
thx again!
 
Bruno

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

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 18 Jul 2010
Article Copyright 2010 by Raymund Macaalay
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid