Content Query Web Part Customization Overview
Oskar asked me today if I could walk some folks on his team through what can be done with the CQWP out of the box with no code. So before I write that up tonight, I figured I'd quickly describe what I know how to do and what I don't. Unfortunately, the later list is larger and more formidable than the former.
So the problem that I solved was this:
- Project portal has four sub-sites for sub-projects.
- Each sub-site has a list of Scrum sprints. The actual names of the lists are not important, what is important is that the lists have the same column names.
- I needed to get all items from all Scrum sprints and show them in one place. The output values included calculated columns, numeric columns and text columns.
- The values I pulled did not include multi-value or multi-choice columns. I may include these in my write up but I don't think they are particularly useful in this context.
- Each sprint line item had a status value that was manually set through a hard wired drop down list in that site. I did not use a site column or a content type for this.
- Each line item status string also corresponded to the file name of an image. This allowed me to semi-dynamically show a KPI-style indicator of the sprint status.
So what you can do with the CQWP:
- Pull many items from many lists into one view.
- Dynamically make simple decisions about each line item in a list to change individual item displays.
- Sort all data returned, regardless of what list they originated from.
- Group data based on the list that items were pulled from.
What you cannot do (or more likely I don't know how [yet]) with the CQWP:
- Combine multiple items from multiple lists into one display item. By this I mean that I haven't found a way in the xsl to take manager from site list A, subordinate from site list B and and hourly rate from site list C and show all items on one line as if they were the same list item.
- Aggregate, roll up or summarize list items in a group header or in the CQWP header. I know that xsl is pretty powerful but I am not sure how this would work. I seem to recall that xsl is a forward-only processing engine. If that's true, although you could aggregate values in variables, you would have no where to show them unless you were able to somehow create a group footer. Caveat emptor here.
- Still, there is a group header style in a WSS site collection so there may be hope. If anyone knows how to do this, please spill it!
- BDC Content: I don't know how BDC data is presented in SharePoint so I can't say whether or not this is possible. I have a project coming up that will probably be hitting Oracle business data from a MOSS platform so I'll test this out in the future if the opportunity presents itself.
So in the true reporting sense, this is not a reporting tool but it is certainly a tool that would be handy as part of a dashboard where you need line items from many sources coalesced into a single view.
JJ