Wednesday, May 2, 2012

Connect to multiple sub-sites in Data View Web Part 2010


Supporters of End User


Item is currently unrated. Press SHIFT+ENTER to rate this item.
Categories:SharePoint Designer; Data View Web Part; Site Manager/Power User; MOSS; WSS; 2010

You may also be interested in: Assigning SharePoint Column View Permissions by SharePointBoost


Editor's note: Contributor Kim Frehe is a SharePoint Solution Specialist at Rightpoint Consulting. Follow her @KimFrehe
In SharePoint 2007, the Data View Web part (DVWP) was all the rage. You could create complex views from multiple sites within in your site collection or other data sources and group, sort and format the data in a visually appealing and meaningful way.
SharePoint Designer 2007 made it easy for you to connect multiple lists on sub-sites with a handy little “Connect to another library…” link at the bottom of the data sources task pane. With all the improvements Microsoft has made with the Content Query Web Part, I was excited to use the DVWP as a sort of expanded version of information that I show in a CQWP. However, SharePoint Designer 2010 has gotten rid of the task pane and the handy little link that allows you to quickly connect data sources to display in the DVWP. Out of the box you can see your site’s document libraries and lists in the data sources.
So the question is, how do you combine data from multiple sub-sites to display in a consolidated list? For this example, I have 8 departments and each department has a sub-site. Each of these sub-sites has a “Goals” list that uses a global content type in a custom task list. I want to consolidate each department’s goals on the parent site to display a view the company-wide goals.
Inbar Cizar (@Cizi) does an excellent job of explaining how to add a sub-site’s list to your list of data sources in this post: http://blogs.microsoft.co.il/blogs/cizi/archive/2010/08/01/connect-to-another-library-in-sharepoint-designer-2010.aspx
Once you have added each of your department’s goals as a data source, you will need to create a “Linked Data Sources” and use this Linked Data Source in your Data View Web Part
2012-04-17-ConnectMutlipleSubsites-01.png
Then open an existing or create a new page (I used an .aspx page)
On the ribbon, click on the down arrow on the Data View button and select your Linked Data Source.
2012-04-17-ConnectMutlipleSubsites-02.png
From there you can add your columns, group, sort and modify the DVWP as needed.
NOTE:
Name your SOAP datasources carefully; you can use the name of the connection to group or sort a DVWP by the name of the sub-site, or whatever you call it. After the datasources have been connected as a Linked Source, any name changes are not reflected, so you will need to create a new Linked Source to reflect a name change.
Here are instructions to group the DVWP by the site name, which is what I named the SOAP Service datasource.
  1. Call your “SOAP Services” data source the name of your sub-site.
  2. Click on sort and Group
  3. Select “Add Sort Expression…”
  4. Select “agg:source”
2012-04-17-ConnectMutlipleSubsites-03.png

No comments:

Post a Comment