Take the 2-minute tour ×
SharePoint Stack Exchange is a question and answer site for SharePoint enthusiasts. It's 100% free, no registration required.

Is it possible to get a list of all items (list items, publishing pages, library items) that are checked out and not published yet? We've noticed that if we use the content deployment feature in SharePoint 2010, items that aren't published and are pending don't get moved (which makes sense). So we'd like to remind users to publish items before we do the deployment. Thanks.

share|improve this question
1  
Try using the content query web part? –  David Lozzi Nov 28 '11 at 15:10

2 Answers 2

up vote 2 down vote accepted

If you have publishing site, The best and easy way to do this is to use "Manage Content and Structure", It has many queries which can be used for report For e.g. "Pending Approval". Also, You can add more queries for more reports. In your case, you can enter a new query to find "All checked out users" in the Content and Structure Reports list like below.

<Where><Geq><FieldRef Name="CheckoutUser" LookupId="TRUE"/><Value Type="int">0</Value></Geq></Where> 

If you want to do it programmatically, you can use SPSiteDataQuery. For e.g. The below function gives you no of files that are checked out:

private int? NoOfFilesCheckedOut()
        {
            int? noOfFileCheckedOut = null;
            SPWeb oWeb;
            SPSiteDataQuery query;

                oWeb = SPContext.Current.Web;
                query = new SPSiteDataQuery();
                query.Lists = "<Lists BaseType='1' Hidden='TRUE'/>";
                query.Webs = "<Webs Scope='SiteCollection' />";
                query.Query = "<Where><IsNotNull><FieldRef Name='CheckoutUser'/></IsNotNull></Where>";

                DataTable dtResults = oWeb.GetSiteData(query);

                        if (dtResults != null && dtResults.Rows.Count > 0)
                            noOfFileCheckedOut = dtResults.Rows.Count;
                        else
                            noOfFileCheckedOut = 0;  


            return noOfFileCheckedOut;        

        } 
share|improve this answer

Use the Manage Content and Structure function in the Site Actions menu. Then change the view on the right hand side to filter for the correct content.

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.