1,804 articles and 14,400 comments as of Wednesday, December 29th, 2010

Tuesday, April 6, 2010

SharePoint: Reproducing a Roll-Up DataViewWebPart in Another Web

Guest Author: James Love
Chronicles of a Chronic E-Junkie

After reading a fantastic post by Laura Rogers on displaying a roll-up web part using Sharepoint Designer and the all-powerful DataViewWebPart, I came across a need to produce a similar (but summarised) view of a Roll-up on another site.

My current full rollup exists in a Web which recurses its sub Webs to extract details. What I wanted was a summary of this view on the Top-level site homepage (default.aspx).

I was able to "Connect to another library" and add the site in which the main roll-up exists to my Data Source Library for the top-level site, but when I changed mode to CrossList and set the Webs mode to Recursive in the mark-up (all this detailed in Laura’s blog post linked above), all I saw in the Data Source Details was 3 fields, ListId, WebId and ID. No others :(

What I needed to do, it turns out, was hit a little sly link below the title text "Current Data Source:", which brings up a dialogue box letting you filter or sort the Data Source query. This also has a drop down box entitled "Item and Folder Scope". Setting this to Recursive then displayed all the fields in the List I was connecting to, and when I went to "Edit Columns" in Common Data View Tasks, I could see everything and add/remove columns as I needed for this summary view.

When sorting my data in the roll-up, I have to also use this dialogue box to set the sort parameters, as doing it via the Common Data View Tasks results in an empty result set.

So, when making a recursive roll-up for another Web, ensure you set the Item scope to Recursive in  SPD, as well as adding the XML tag "Webs" to the selectCommand!

 

Guest Author: James Love
Chronicles of a Chronic E-Junkie

James Love works as an Information Officer for a small non-profit organisation in York, UK. Whilst developing solutions for the company’s intranet environment, he also spends time looking after IT operations and strategy. As well as web development & design, James has a keen interest in Information Architecture best practices for the corporate environment. He is a regular attendee of Sharepoint User Group UK events in Northern England.

 

Please Join the Discussion

9 Responses to “SharePoint: Reproducing a Roll-Up DataViewWebPart in Another Web”
  1. Dan Blaker says:

    Nice post! Great tips. I’m curious about your original roll-up which “recurses sub-webs to provide details”. How does that work? I’m working on a similar PMO site where I’ve got a subsite for each project, but I’m not sure how best to embed or surface metadata for each site.

    • James Love says:

      Hi Dan,

      Thanks for the kind comment! It sounds like you have a set up very similar to what I’m running – a PMO Web with a sub web for each project.

      You’ll need to make sure each sub web has a List made from a Site Content Type (Or a List Template).

      I’d strongly recommend reading Laura Roger’s post on creating a roll-up web part. Ignore the details on Grouping the results, and ensure you add the Webs Recursive = Webs statement to the selectCommand, and also set the Data Source Mode to CrossList within the Code view.

      If you’ve read through that and are still stuck, just let me know and I’ll be happy to describe the process in detail, as well as adding a couple of flourishes I’ve added to my “PMO Dashboard” roll-up which enhances user experience.

      • James Love says:

        Apologies, I meant “Webs Scope = Recursive”.

        Again, feel free to ask for a detailed how-to if you need a hand.

      • Dan Blaker says:

        So in your case you have a custom list named “Details” in each sub-web. Is there just a single row of data in each “Details” list? If that list holds metadata about the sub-web, I don’t see how you’d want more than one row.

        Ideally, I’d like a dashboard that resembles what you get when you click “Sites” in the sidebar of a Team site (i.e., viewlsts.aspx?ShowSites=1), except with more columns (e.g. “Budget”, “Project Status”) in addition to “Last Modified”, etc.

        If I’m understanding it correctly, your approach is a clever workaround to the lack of metadata for a web. It’s too bad you can’t pick up the “Last Modified” field, but otherwise it’s very cool.

      • James Love says:

        Hi Dan,

        Yes, each sub web has a list called Details from a Content Type, with one row of data for that particular project.

        I have an instance of this list in the main PMO web, which the roll-up draws from (then recurses), which has no information in it.

        This also works if this Details List has multiple rows in it, which I use to store “historical” projects’ details, for user reference.

        My PMO also hides rows from the roll-up where the Project Status is marked as “Completed”, and also highlights overdue projects, or projects for a specific customer.

        I agree that the lack of ability to pick up the “Last Modified” column in ViewLists would be incredibly useful for this architecture, I might see if I can find out more information on this.

      • Are you guys trying to get at the Last Modified date/time for all the items in each list? You can do this by looking at the Modified column for each Details item, right?

        Also “I have an instance of this list in the main PMO web, which the roll-up draws from (then recurses), which has no information in it.” –> There doesn’t need to be a “placeholder” list (if I iunderstand what you are saying). All of the list items which match your criteria will be selected based on the scope and filters.

        M.

    • Christophe says:

      Dan, I have some information on my blog, including templates available for download:
      http://blog.pathtosharepoint.com/?s=roll-up

      I have yet to write parts III and IV…

    • Dan Blaker says:

      Marc, I’m trying to get the “Last Modified” for all the sub-webs in the current web. Would be handy for identifying stagnant sites via the same Project Site roll-up James describes.

      • I guess that’s a little tricky depending on what you consider a modification. You can certainly look for the most recent item “touch” in a sub-web by grabbing the one with the most recent Modified date. There’s also a Modified date on every list, if that’s more what your definition would be. Bottom line is, I think you can do it, and without server-side code. SPServices can even help (he said, like a broken record). The hard part is probably deciding what “Last Modified” means.

        M.


Notify me of comments to this article:


Speak and you will be heard.

We check comments hourly.
If you want a pic to show with your comment, go get a gravatar!