AXForum  
Вернуться   AXForum > Microsoft Dynamics CRM > Dynamics CRM: Blogs
All
Забыли пароль?
Зарегистрироваться Правила Справка Пользователи Сообщения за день Поиск

 
 
Опции темы Поиск в этой теме Опции просмотра
Старый 07.11.2013, 06:11   #1  
Blog bot is offline
Blog bot
Участник
 
25,643 / 848 (80) +++++++
Регистрация: 28.10.2006
mscrmblog: Getting total document count for a SharePoint site
Источник: http://mscrmblog.net/2013/11/07/gett...arepoint-site/
==============

I had a customer wanting to find out the total number of documents under a site. Quickly came up with a Webservice method that ran a query on all the lists on the site to get a total count. Run this from a ribbon or in your custom web app solution in SharePoint



[WebMethod] public string GetDocumentCount(string webUrl) { var DocumentCountTxt = new StringBuilder(); try { int totalItems = 0; string siteName = ""; using (var site = new SPSite(webUrl)) { using (SPWeb web = site.OpenWeb()) { siteName = web.Title; var query = new SPQuery(); query.ViewAttributes = "Scope='Recursive'"; foreach (SPList list in web.Lists) { totalItems += list.GetItems(query).Count; } } } DocumentCountTxt.Append(String.Format("Found a total of {0} Documents In '{1}'", totalItems, siteName)); } catch (Exception ex) { DocumentCountTxt.Append(String.Format("An Error has occured: {0}", ex.Message)); } return DocumentCountTxt.ToString(); }



Источник: http://mscrmblog.net/2013/11/07/gett...arepoint-site/
__________________
Расскажите о новых и интересных блогах по Microsoft Dynamics, напишите личное сообщение администратору.
 

Похожие темы
Тема Автор Раздел Ответов Посл. сообщение
atinkerersnotebook: Creating Your Own Document Management System With SharePoint Blog bot DAX Blogs 0 02.10.2013 21:12
dynamics-coe: Introducing the SharePoint Product Catalog site for Dynamics AX Retail Blog bot DAX Blogs 0 13.02.2013 16:11
Microsoft Dynamics CRM Team Blog: Impact of Dynamics CRM December 2012 Service Update and SharePoint Online Service Update on CRM-SharePoint Integration Blog bot Dynamics CRM: Blogs 0 09.01.2013 01:11
gustafwesterlund: SharePoint as document management storage for Dynamics CRM Blog bot Dynamics CRM: Blogs 0 12.11.2012 01:12
mscrmblog: SP - Uploading files to SharePoint document library Blog bot Dynamics CRM: Blogs 0 10.03.2010 01:05

Ваши права в разделе
Вы не можете создавать новые темы
Вы не можете отвечать в темах
Вы не можете прикреплять вложения
Вы не можете редактировать свои сообщения

BB коды Вкл.
Смайлы Вкл.
[IMG] код Вкл.
HTML код Выкл.
Быстрый переход

Рейтинг@Mail.ru
Часовой пояс GMT +3, время: 18:09.