Friday, February 27, 2015

A report of all checked out documents

The easiest way to get a report of all checked out files is by using powershell script as described in the blog

http://www.sharepointdiary.com/2013/02/find-all-checked-out-files-and-check-in.html

Another option is to use web services see below blog for reference

http://sqlblogcasts.com/blogs/drjohn/archive/2007/11/02/Getting-a-list-of-files-from-a-moss-document-library-using-a-SharePoint-web-service.aspx

Also This blog mentions a very easy way to create a report of all documents which are currently checked out in a site it is listed again here 


1) Go to (out of the box) List  'Content and Structure Reports' and add a New Item.
2) Fill the following values:
    Report Title : CheckedOutFiles
    Resource Id : SmtCheckOutUser
    Resource Id : SmtCheckedOutReportDescription
    CAML List Type : <Lists ServerTemplate="101"/>
    CAML Query : <Where><Geq><FieldRef Name='CheckoutUser' LookupId='TRUE'/><Value Type='int'>0</Value></Geq></Where>
     Report Description : All documents and pages checked out in this site and subsites
3) Navigate to Site Settings -> Site Administration -> Content and structure
4) This gives context to the right-hand window where you can look at views and manipulate content in certain ways.
5) If you click on view: and choose the latest added 'Content and structure' item you can view all the documents checked out in all the document library in the site and its subsite



Add custom CSS styles to XSLT List View webpart

To add custom css styles to xslt list view webpart follow these steps

  1. Create a new view on the list or document library
  2. Edit the view in sharepoint designer and generate custom xslt styles for the entire view
    • Open the view in Sharepoint designer
    • Click on Design tab
    • Click on Customize Entire View option





  1. Find this code 
  2. <xsl:template match="View" mode="footer">
      </xsl:template>


  3. Replace it with your styles embedded in it
  4. e.g.

    <xsl:template match="View" mode="footer">
    <style type="text/css">
    .ms-bodyareaframe {
    padding: 0px;
    }
    .ms-vh A:link, .ms-vb A:link, .ms-vb2, .ms-vh2 A, Nobr SPAN A:link, div.noindex table.ms-listviewtable tr.ms-viewheadertr th.ms-vh2 div.ms-vh-div,
    table.s4-wpTopTable div.noindex tr.ms-viewheadertr th.ms-vh2 div.ms-vh-div, td.ms-gb
    {
    color: green;
    text-decoration: none;
    font-family:&quot;Segoe UI&quot;;
    font-size:8pt;
    font-weight: normal;
    }
    .ms-viewheadertr, .ms-vhltr
    {
    background-color:silver;
    }
    </style> </xsl:template>


  5. Save and close Sharepoint designer 
  6. Refresh the view in browser

Thursday, February 19, 2015

Sharepoint log memory allocation stack trace

Use this command in SP power shell window to switch on stack trace logging in case of an error.
I found it here

Add-PSSnapin Microsoft.SharePoint.PowerShell -ErrorAction SilentlyContinue
[System.Reflection.Assembly]::LoadFile($Env:CommonProgramFiles+"Microsoft SharedWeb Server Extensions14ISAPIMicrosoft.SharePoint.dll") | out-null

# Get Content Service of the farm
$contentService = [Microsoft.SharePoint.Administration.SPWebService]::ContentService

# Display and change the setting of property "CollectSPRequestAllocationCallStacks"
write-host "Current: " $contentService.CollectSPRequestAllocationCallStacks 
$contentService.CollectSPRequestAllocationCallStacks = $true
$contentService.Update()

write-host "    New: " $contentService.CollectSPRequestAllocationCallStacks 

c# httpclient The remote certificate is invalid according to the validation procedure: RemoteCertificateNameMismatch

 If we get this error while trying to get http reponse using HttpClient object, it could mean that certificate validation fails for the remo...