views:

90

answers:

1

Hi all,

I have a sharepoint site which contains site and subsite and document libraries in it. Couple of document library has setting to maintain the versioning of the doc along with the comments.

Now I have requirment where a client wants to see this settings site wise as, under which site how meny doc libraries are there which have versioning enabled...?

I want to show this information as an report.

Do I need to write a custom webPart or code for it ? Or how can I show this information as a report in sharepoint.

Thanks in advance. Sachin

A: 

Versioning information is a property of the SPList class even though only document libraries can use versioning in SharePoint.

How you output this is up to you but here is some quick code to get you started.

Use the SPWeb.GetListsOfTypeMethod(SPBaseType.SPDocumentLibrary) to return an SPListCollection, loop through the list collection checking for the SPList.EnableVersioning property.

//Get your SPWeb whichever way works best

SPListCollection lists = web.GetListsofType(SPDocumentLibrary);
foreach (SPList list in lists)
{
     if(list.EnableVersioning = true) 
     {
      // Write to a list or update a count
     }

//Output count results or a list of the doc libraries
}  

Cheers, CJ

Junx