Debugging Content Query Web Part

Content Query Web Part (CQWP) is one of the coolest web parts available out of the box in MOSS 2007. Using nothing more than the standard functionality you can aggregate content available within your Site Collection. Additionally you can extend the CQWP by introducing new XSLT parameters and functions, what allows you to create pretty complex data presentation including paging.

The downside of customizing the CQWP is that it doesn’t present you with sufficient feedback should you have done something wrong. If you do something wrong in the XSLT, all you see is the following error:

Unable to display this Web Part. To troubleshoot the problem, open this Web page in a Windows SharePoint Services-compatible HTML editor such as Microsoft Office SharePoint Designer. If the problem persists, contact your Web server administrator.

What many of you don’t know however is that the actual reason of why rendering the Web Part has failed is being logged in the SharePoint log files (default location: 12\LOGS). If it’s an XSLT error just look for a System.Xml.Xsl.XslTransformException and you should found what went wrong. In most cases the error message provides you with explanation which should give you some idea of how to fix the error.

Technorati Tags: SharePoint, SharePoint 2007, MOSS 2007


comments powered by Disqus