Geeks With Blogs
Simon's blog
Issue:

By default the Content Query WebPart can only enumerate through 1000 lists/libraries/etc, this is for performance reasons, if this amount is increased too far, then the SQL server can experience issues responding.

Solution:

To increase the number, the CQWP needs to be edited, as usual with customising webparts as well as pretty much any OOB features in SharePoint, it is best to take a copy of the existing webpart and create a new one.


To do this:
1.    Add the CQWP to a webpart page and from the small dropdown menu on the webpart; choose Export, save it somewhere on either your local disk or a fileshare,
2.    Open the .webpart file in an XML editor and search for:
           <property name="ListsOverride" type="string"/>
3.    Change to:
           <property name="ListsOverride" type="string">
           <![CDATA[<Lists Servertemplate="XXX" MaxListLimit="YYYY"></Lists>]]>
           </property>

Where XXX is the list template number (see below) and YYYY is the maximum number of lists to go through.  This maximum should be increased only to the point at which the webpart functions as too large a number can have a negative impact on performance.

4.    Save the new webpart with a meaningful such as Content Query High List Numbers.webpart
5.    Go to the page where you want to add the new webpart, click Editing Tools > Insert > Web Part.  Click Upload a Web Part beneath the Categories, navigate to and select your new webpart.
6.    Click Add, select the correct Content and item type as you would with any Content Query WebPart.  The rest of the options should be select as usual including Filtering and Grouping.


Ideally attempts should be made to reduce the number of lists/libraries that this webpart has to enumerate through, increasing this limit should really be a temporary fix rather than a long term solution, the more lists/libraries the webpart has to go through the more work the SQL server has to perform.

SharePoint 2010 List Type Codes:

100 Generic list
101 Document library
102 Survey
103 Links list
104 Announcements list
105 Contacts list
106 Events list
107 Tasks list
108 Discussion board
109 Picture library
110 Data sources
111 Site template gallery
112 User Information list
113 Web Part gallery
114 List template gallery
115 XML Form library
116 Master pages gallery
117 No-Code Workflows
118 Custom Workflow Process
119 Wiki Page library
120 Custom grid for a list
130 Data Connection library
140 Workflow History
150 Gantt Tasks list
200 Meeting Series list
201 Meeting Agenda list
202 Meeting Attendees list
204 Meeting Decisions list
207 Meeting Objectives list
210 Meeting text box
211 Meeting Things To Bring list
212 Meeting Workspace Pages list
300 Portal Sites list
301 Blog Posts list
302 Blog Comments list
303 Blog Categories list
850 Page Library
1100 Issue tracking
1200 Administrator tasks list
2002 Personal document library
2003 Private document library
Posted on Wednesday, May 8, 2013 2:01 PM SharePoint 2010 , CQWP , Content Query WebPart | Back to top


Comments on this post: Increasing the number of lists a Content Query Webpart can enumerate through

No comments posted yet.
Your comment:
 (will show your gravatar)


Copyright © simonh | Powered by: GeeksWithBlogs.net