Using the CrossListQueryInfo and CrossListQueryCache

I found some article about how to query data from cross-list.

I listed them below, I think that It's gonna be help when some scenario happens.

You are not clear so as to what type of Data Retrieval you are after. Anyway, let me guide you to some possible options within a custom webpart like scenario.

SPSiteDataQuery - This is useful for making query for a single type of list or single base types of list to pull back data based on your CAML. It would work on both SiteCollection and Recursive mode (for details check out link posted by Sandip).
Working example - http://www.zimmergren.net/archive/2008/03/09/sharepoint-cross-list-queries-in-a-custom-usercontrol.aspx

CrossSiteListQuery - A counterpart alternative to using SPSiteDataQuery with enhanced ability to switch caching on and off. It can help you leverage performance to some extent but again that depends on your data retrieval and complexity of query.
Working example - http://bloggingabout.net/blogs/bas/archive/2009/03/27/using-the-crosslistqueryinfo-and-crosslistquerycache.aspx

Remember, both of these return back SPListItemCollection a mega useful block of information and also the ability to integrate this with .Net controls like DataTable, GridView etc. which can greatly enhance the output for your end users. Both these will do a crawl for data based on webs property and you have to decide cost performance based on the size of your site collections and subsites within the same. 

Using SQL Reporting Services is an overkill provided you are after a single list type data collection, needless to say if there are multiple lists of different base types surely you can investigate SQLRS a bit further. Inevitably Sahil Malik's posts will become your best friend -
http://blah.winsmarts.com/2007-12-SharePoint_and_SQL_Server_Reporting_Services_-_Installation_and_Setup.aspx

Hope this helps you steer towards the right direction.

http://bloggingabout.net/blogs/bas/archive/2009/03/27/using-the-crosslistqueryinfo-and-crosslistquerycache.aspx

原文地址:https://www.cnblogs.com/sharepointhome/p/2098161.html