Developed September 2015 for a customer.
This web part displays the total count of list items in your system. Configurable to support all the list items specific to your requirements.
Note: Request from support@lookout-software.com.
Installation
- Install the ListItemCountsReport.wsp web part as you would any other web part:
- CMD shell (in the same folder as the ListItemCountsReport.wsp file):
%WINDOWS DRIVE%\%PROGRAMFILES%\Common Files\microsoft shared\web server extensions\12\bin\stsadm.exe –o addsolution –filename ListItemCountsReport.wsp
%WINDOWS DRIVE%\%PROGRAMFILES%\Common Files\microsoft shared\web server extensions\12\bin\stsadm.exe –o deploysolution –name ListItemCountsReport.wsp –URL [site collection URL] –allowcas -immediate
(these are separate commands, type first one, press enter, then second one and enter)
OR
SharePoint Management Shell (in the same folder as the ListItemCountsReport.wsp file):
- Add-SPSolution “$(gl)\ListItemCountsReport.wsp”
- Install-SPSolution –Identity ListItemCountsReport.wsp –WebApplication [site collection URL] –CASPolicies
Note: These are separate commands, type first one, press enter, then the second one and enter.
Next:
- Go to the top level site (that contains Flex site) and into Site Settings, Site collection features.
- Activate the “List Item Counts Report” by clicking the “Activate” button
- Go back to Flex site and to the page that you want to add the output. Put the page in “Edit” mode:
- Click “Add a Web Part” and you should find the report web part in the “LookOut” Category named as “List Items Counts Report”:
- After adding, the web part will display a message that it can’t find a setting. Add a Setting named “ListItemCountsReport” that contains a list of lists (each on a separate line) that you want to display totals for.
- Refresh the cache and the web part should now be displaying results.
Notes:
- The web part uses CRMSideBar to access lists – this cuts down on the amount of code necessary and prevents the web part from being used in non-Flex-licensed sites.
- There are two main ways of retrieving list item totals in SharePoint. The first is to perform a query on the list and then count the results; however, this can be slow depending on the size of the list and we don’t want that. Microsoft is aware of this and thus have provided a second way.
- The second way is to use a built-in property that SharePoint maintains and caches. Because of this caching, it may sometimes be inaccurate until SharePoint has had a chance to update it. This report uses this method.