locked
XsltListViewWebPart: Cross site RRS feed

  • Question

  • Hi!
    I have a sharepoint 2010 sitecollection looking like this:

    /                (RootSiteCollection)
    /team/        (Teamsite)
    /doccenter/ (DocumentCenter)

    In Document Center there is a document library called CentralDocuments.

    I wonder if I can use XsltListViewWebPart to show a view from the /doccenter/CentralDocuments on /team/ site start page.
    Using it for showing at the same site is standard and you have it when you choose add webpart. But I want to use it cross sites and still have possibility for ribbon etc.  If this is in no way possible, how could one do it?

    Findwise AB
    Wednesday, February 3, 2010 7:47 PM

All replies

  • The ability to make a connection cross site directly is not available in SharePoint Designer 2010. However, I would recommend making a web service connection using the Lists.asmx web service to get access to lists or libraries on other sites. This can work across sites or even site collections. Once you make the connection using SharePoint Designer, then the information from that connection can be shown using the XSLT web part.
    Asif Rehmani, MVP. Host of http://www.sharepoint-videos.com (SharePoint and InfoPath Video Tutorials). Co-author of Book "Professional SharePoint Designer 2007"
    Monday, February 8, 2010 7:42 PM
  • The ability to make a connection cross site directly is not available in SharePoint Designer 2010. However, I would recommend making a web service connection using the Lists.asmx web service to get access to lists or libraries on other sites. This can work across sites or even site collections. Once you make the connection using SharePoint Designer, then the information from that connection can be shown using the XSLT web part.
    Asif Rehmani, MVP. Host of http://www.sharepoint-videos.com (SharePoint and InfoPath Video Tutorials). Co-author of Book "Professional SharePoint Designer 2007"
    Thanks for your reply. I have now tried this and have actually looked at your sharepoint video for setting up web services connections to sp designer 2010. I can show, as you do, the list collections. But this is showed with the DataFormWebPart and not the XsltListViewWebPart. So I still do not have any connection to like ribbon and features like add/update/delete which I would like to. My aim is of course to have the same functionality as having a normal list view of a document library on any site. Cant understand why this feature doesn't exist easily out of the box. Do you have any tricks in your sleeves for solving this?

    Findwise AB
    Tuesday, February 9, 2010 5:30 PM
  • If you need to display list data across site (e.g. parent site to subsite) within the same site collection, you can follow these steps:


    1) Open the parent site in SPD 2010. 
    2) Select "Lists and Libraries" from the left navigation pane
    3) Select a list
    4) In the "Views" section on the right, either open an existing view (e.g. AllItems.aspx) or create a new view.
    5) In SPD page editor, click on the view.
    6) In the Ribbon UI, go to List View Tools -> Web Part tab
    7) Click "To Site Gallery" from "Save Web Part" section.
    8) Give it a name and description (e.g. "ParentA")
    9) Click "Yes" when the message pops up.  This ensures that the web part will point to the original source (i.e. main site)
    10) In the browser, go to your subsite
    11) Edit the page, insert web part through the browser ribbon.
    12) Go to Miscellaneous section, and select the web part you saved.

    This web part will display data from the parent site.  This is an XSLTListViewViewWebPart (not DFWP), so you still get Ribbon UI and can edit the content directly from the subsite.
    Sunday, February 21, 2010 9:21 PM
  • If you need to display list data across site (e.g. parent site to subsite) within the same site collection, you can follow these steps:


    1) Open the parent site in SPD 2010. 
    2) Select "Lists and Libraries" from the left navigation pane
    3) Select a list
    4) In the "Views" section on the right, either open an existing view (e.g. AllItems.aspx) or create a new view.
    5) In SPD page editor, click on the view.
    6) In the Ribbon UI, go to List View Tools -> Web Part tab
    7) Click "To Site Gallery" from "Save Web Part" section.
    8) Give it a name and description (e.g. "ParentA")
    9) Click "Yes" when the message pops up.  This ensures that the web part will point to the original source (i.e. main site)
    10) In the browser, go to your subsite
    11) Edit the page, insert web part through the browser ribbon.
    12) Go to Miscellaneous section, and select the web part you saved.

    This web part will display data from the parent site.  This is an XSLTListViewViewWebPart (not DFWP), so you still get Ribbon UI and can edit the content directly from the subsite.
    Wow! This worked like a charm. Thanks Greg. I think though that I found a bug in this. If I do what you sad and addid to another site I can upload documents, change views etc. But what I can't do is create new Folder. Clicking this in the ribbon gives me this error:

    Error

    List does not exist.

    The page you selected contains a list that does not exist.  It may have been deleted by another user.

    Troubleshoot issues with Microsoft SharePoint Foundation.

    Correlation ID: 681a0932-4874-4170-9902-8f46afae7dc3

    Date and Time: 2/22/2010 10:45:11 AM

     

     

    Do you have any idea about this?

    Findwise AB
    Monday, February 22, 2010 9:45 AM
  • This worked brilliantly for me against a 'test' list, but my 'real' list has several content types, and I am finding this technique doesn't work if the parent list has "Allow management of content types" set to Yes.  Any ideas?? 

    Monday, April 5, 2010 1:39 AM
  • I followed these steps and when I try to add the web part from "Miscellaneous" I get the following error:
    "List does not exits.
    The page you selected contains a list that does not exst. It may have been deleted by another user."

    I also tried adding the web part through SPD which works, however, when I try to access the actual items listed (under "subject" column) through the browser, I get a "No item exists" error because the path the item is pointing to is a relative path and not pointing at the list of origin.

    Thanks for any assistance you can offer.

    -Megan

     

    Thursday, June 3, 2010 5:47 PM
  • Greg - I followed your steps, but unfortunately I got the error: An unexpected error has occurred.

    Which correlates to: 

    12/22/2010 15:58:41.67  w3wp.exe (0x0AE4)                        0x0798 SharePoint Foundation          Runtime                        tkau Unexpected System.ArgumentException: Value does not fall within the expected range.    at Microsoft.SharePoint.SPWeb.GetWebRelativeUrlFromUrl(String strUrl, Boolean includeQueryString, Boolean canonicalizeUrl)     at Microsoft.SharePoint.SPWeb.GetFolder(String strUrl)     at Microsoft.SharePoint.WebControls.NewMenu.AddMenuItems()     at Microsoft.SharePoint.WebControls.ToolBarMenuButton.CreateChildControls()     at Microsoft.SharePoint.WebControls.NewMenu.CreateChildControls()     at System.Web.UI.Control.EnsureChildControls()     at Microsoft.SharePoint.WebControls.TemplateBasedControl.OnLoad(EventArgs e)     at Microsoft.SharePoint.WebControls.ToolBarMenuButton.OnLoad(EventArgs e)     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.LoadRecursive()     at System.Web.UI.Control.... 1663f772-afbe-466c-8ebb-9be2cb2a1663

    This is the same error that I get with the upgraded XsltListView (it was ported from a 2007 List View that was pointing at another site).

    Anyone got any ideas?

    Wednesday, December 22, 2010 6:01 AM
  • Peter, have you tried adding the webpart from SPD instead? I was getting the same exception in the LOG when I tried to add it from "Edit Page" but from SPD I can add it and although theres a popup error message it works fine. Were you able to solve the issue, if yes Id like to know how.

    Shoaib

    Tuesday, January 4, 2011 8:27 AM
  • Hi Shoaib, I followed Greg's steps above which are for SPD.
    Wednesday, January 5, 2011 7:31 AM
  • Sorry Shoaib, you meant for step #10 - I'm stupid. This works!

    (Well, the expanding the group-by view doesn't seem to work properly, but this could just be the server - need to test on client).

     

    Thanks.

    Wednesday, January 5, 2011 7:54 AM
  • If I use a parent site view with a collapsed Group-By it is broken:

     - The word "Loading..." appears under the item to expand
     - The area below the item expands, but goes blank
     - IE appears to lock-up if you have "Tabular View" enabled. If you don't have this enabled, it expands quickly (but no results are shown)
     - After some time, IE stops hanging and you can scroll, but no results are shown (the area remains blank)

    An expanded view works, even when I collapse and re-expand the view. It's very strange.

    Update: The following error appears to occur when you expand the list:

    01/06/2011 15:07:15.90  w3wp.exe (0x0FBC)                        0x0DE0 SharePoint Foundation          General                        8kh7 High     List does not exist.  The page you selected contains a list that does not exist.  It may have been deleted by another user. 9ece8f4f-6600-47c8-94a1-3f743be74a09

    (Remember, in Step #9 above I chose "Yes" not "No", so it should be finding the list! Perhaps it's an AJAX bug, the AAM is correct for the site)

    Wednesday, January 5, 2011 11:44 PM
  • Hello, I am not able to open subfolders. Do you have an Idea for me?

     

    thanks

    Thursday, March 31, 2011 7:13 AM
  • Same scenario here as Kim has described. Is there a confirmation from Microsoft that re-using XSLT List Views on different sites in the site collection doesn't work if the list allows "Management of content types"?
    Monday, May 9, 2011 8:32 PM
  • The same error after adding this webpart to the page (List not found: list id=...)

    Sharepoint shows my page one time after adding webpart and then it began to generate error.

    at the same time when I open page in SPDesigner it shows preview with data from list on different site without error

    List allows Management of content types. It's "Listings" list (came from SPS2003)

    Wednesday, July 27, 2011 6:48 AM
  • Hi,

    We builds an XsltListViewWebPart programmatically setting WebId and ListId from an existing web part and allow this new web part to be available from any subsite existing in our solution. Almost everything works fine except when user use action in the ribbon showin g this error : List does not exist.  The page you selected contains a list that does not exist.  It may have been deleted by another user.

    I check ULS log and the path using when clicking action in the ribbon looks wrong and does not refer to the good site where the original list was. Any idea? SharePoint bug?

    Wednesday, December 21, 2011 7:17 PM
  • We used Greg's method for about 6 months and it works fine until the source list has more than approx 500 entries. Once the source gets past that number, performance on the site pages that use the web part decreases dramatically (on the order of 1000 to 2000 percent increase). For example, a page without the web part loads in 1-2 seconds, whereas a page with the web part takes 18 - 24 seconds. This is with 800 items in the source list. We have investiagted this and found a "DECLARE @DocParentIdFor RF" query statement is generated by the web part which causes between 1 - 2 miliion reads on the WSS_Content database when the page with the web part is accessed.

    We are currently searching for a solution to this issue. Would appreciate if anyone has solved this.


    • Edited by bigronguy Thursday, March 15, 2012 7:41 PM
    Thursday, March 15, 2012 7:41 PM
  • Hi all,

    I do exactly the same. Sometimes it works fine, but sometime I get the error: "List does not exist. The page you selected contains a list that does not exist. It may have been deleted by another user.". when I refresh the page (F5), the error dissapears and the page displays well. It seams that only contibutors to the list/library has the issue.

    Any workaround?

    Thanks in advance.

    Thursday, April 26, 2012 3:30 PM