Reporting across several SharePoint sites
Question
We are currently designing a where there are many sites, each site contains a list.
The list in each of these sites has the same fields.
We would like to create a report based on the information in these lists.
Is there a built in way to extract this information? Or do we just have to loop through each site and pull it out?
Solution
If all your sites are in the one site collection, and you can use the SPSiteDataQuery object. It helps if you have a particular content type to query for.
Also, if you've got the publishing features enabled on your site collection, you can use the content query web part. Internally this uses the SPSiteDataQuery class, but it gives you a user interface too.
OTHER TIPS
SharePoint does not allow to use the SPSiteDataQuery
over different site collections at the same time. Plus you need the same content type or list template.
If you want to aggregate over different site collections, you need to do it yourself with the foreach
approach.
Another option is to install the Search Server and perform a Search Query. The advantage is that queries will be faster. The drawback is that data are not onlive (there is a delay caused by the indexation)
If they are within the same site collection, you could use a Content Query web part to aggregate all the data or use a tool like the Lightning Conductor web part from Lightning Tools.