如何获得所有文档库,但表单模板,样式,自定义报表 [英] How to get all document libraries BUT Form Templates, Style, Customized Reports

查看:121
本文介绍了如何获得所有文档库,但表单模板,样式,自定义报表的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我建立的SharePoint 2010的WebPart获得所有与用户有用的信息的文档库。这意味着,该文档用户上传,等我不希望显示库如表单模板,样式库,定制报告,等等...

I'm building a webpart for SharePoint 2010 to get all the document libraries with usefull info for the user. This means, docs that users uploaded, etc. I don't want to show libraries such as Form Templates, Style Library, Customized Reports, etc...

我刚希望仅显示有用信息的文档库,共享文档,或任何其它用户创造未来,这可能吗?

I just want to show only the document libraries with usefull info, as Shared Documents, or any other users create in the future, is that possible?

目前,我的逻辑是这样的

Currently, my logic looks like this:

SPListCollection docLibraryColl = wb.GetListsOfType(SPBaseType.DocumentLibrary);

Guid docLibFeatId = new Guid("00bfea71-e717-4e80-aa17-d0c71b360101");

foreach (SPList list in docLibraryColl)
{
    if (list.TemplateFeatureId == docLibFeatId && !list.Hidden)
    {
        SPDocumentLibrary doclib = (SPDocumentLibrary)list;
        //rest of the logic here...  
    }
}



休息

我读过这里的Guid 00bfea71-e717-4e80-AA17-d0c71b360101 将只返回图书馆与MS文档库模板,但我仍然得到了结果那些不需要的库。

I've read here that Guid 00bfea71-e717-4e80-aa17-d0c71b360101 will return only libraries with MS Document Library template, but I'm still getting those undesired libraries in the results.

推荐答案

这有什么错不包括数据库您想在你的如果

What's wrong with excluding the libraries you don't want in your if?

...
if (!list.Hidden && list.title != "Style Library" && list.title != "Form Templates")
...

您已经选择了 BASETYPE DocumentLibrary,这样你只会收到文档库,遗憾的表单模板是doclib太多,所以你会总是在你的选择。

You are already selecting the BaseType DocumentLibrary, so you will only receive document libraries, unfortunately form templates is a doclib too, so you will always get it in your selection.

这篇关于如何获得所有文档库,但表单模板,样式,自定义报表的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆