开发者

Display document library setting as a report

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 c开发者_运维知识库omments.

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


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

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜