1

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.

1
  • 1
    Try using the content query web part? – David Lozzi Nov 28 '11 at 15:10
2

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;        

        } 
2

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.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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