TwitterLinkedInBlog

Tuesday, September 30, 2014

Export Multiple Lists into a Single Excel File

This is simply a copy of a clever TechNet Forum answer for reference:


After you click Export to Excel and open the owssvr.iqy for the first list, do not close the Excel file, change the connection name from owssvr to something else in Data->Connections->Properties.
go to the next list and click Export to Excel, choose new worksheet instead of new workbook. And rename the connection to the second list from owssvr to something else as before.
This way, you will get one data connection for each list in the same workbook. Save the workbook back to .xls after finishing the last list.

Tuesday, August 26, 2014

PowerShell - Get-SPLogEvent

get-splogevent -StartTime "08/26/2014 01:00" -EndTime "08/26/2014 14:00" |?{$_.Correlation -eq "8b49fbf8-7da2-43k7-ad49-5p02277bc598"} | select Timestamp, Area, Category, Level, EventID, Message | Format-List

Friday, August 22, 2014

Blog - Post.aspx - Intermittent Unable to display this Web Part

Intermittent on Blog Post.aspx:

Unable to display this Web Part. To troubleshoot the problem, open this Web page in Microsoft SharePoint Foundation-compatible HTML editor such as Microsoft SharePoint Designer. If the problem persists, contact your Web server administrator.
Correlation ID

-----
$myfarm = Get-SPFarm
$myfarm.XsltTransformTimeOut
1
-----
$myfarm.XsltTransformTimeOut = 5
$myfarm.Update()
------

Reference:
http://thechriskent.com/2012/06/18/intermittent-unable-to-display-this-web-part-messages/

Friday, August 8, 2014

ItemStyle.xsl - All Field Names

<xsl:for-each select="@*">
    Field Name :<xsl:value-of select="name()" />
</xsl:for-each>

Monday, July 28, 2014

InfoPath 2010 - Web Browser Form

'File' > 'Info' > 'Advanced form options' (At the bottom) > 'Form Options' > 'Compatibility' > 'Form type: Web Browser Form'

Wednesday, July 23, 2014

Content Query Web Part (CQWP) - Author with Presence

Exerpt taken directly from:
http://social.technet.microsoft.com/Forums/sharepoint/en-US/fb79d25c-78b7-452e-9c94-bb5e29063b0c/displaying-authors-with-presence-information-in-a-content-query-web-part-cqwp?forum=sharepointcustomizationprevious

Add the following template to "ContentQueryMain":
 <xsl:template name="OuterTemplate.AuthorPresence">
  <xsl:param name="Author" select="." />
  <xsl:variable name="sEmail" select="ddwrt:UserLookup(string($Author) ,'EMail')" />
  <xsl:variable name="sID" select="ddwrt:UserLookup(string($Author) ,'ID')" />
  <a href="{concat('/_Layouts/userdisp.aspx?ID=', $sID)}" onclick="GoToLinkOrDialogNewWindow(this);return false;">
   <xsl:value-of select="$Author" />
  </a> 
  <img src="/_layouts/images/blank.gif" height="1" width="3" />
  <a href="javascript:" class="ms-imnlink">
   <img width="12" height="12" border="0" src="/_layouts/images/blank.gif" valign="middle" class="ms-imnImg" name="imnmark" alt="No presence information" title="" id="{concat('MWP_pawn_',$ClientId,'_',$sID,',type=sip')}" sip="{$sEmail}"/>
         </a>
 </xsl:template>

This is dependant on adding a reference to the ddwrt namespace in :
xmlns:ddwrt=http://schemas.microsoft.com/WebParts/v2/DataView/runtime

And it is called and referenced like the following in ItemStyles.xsl :
<xsl:variable name="DisplayAuthor">
 <xsl:call-template name="OuterTemplate.AuthorPresence">
  <xsl:with-param name="Author" select="@Author" />
 </xsl:call-template>
</xsl:variable>            
<p>Created By:  <xsl:copy-of select="$DisplayAuthor" /></p>

References:
http://social.technet.microsoft.com/Forums/sharepoint/en-US/fb79d25c-78b7-452e-9c94-bb5e29063b0c/displaying-authors-with-presence-information-in-a-content-query-web-part-cqwp?forum=sharepointcustomizationprevious


Tuesday, July 22, 2014

XSL Security Trimming without SPSecurityTrimmedControl - ddwrt IfHasRights()

<xsl:if test="ddwrt:IfHasRights('2')">
    <div>
        <img src="/_layouts/images/caladd.gif" alt=""/> <a><xsl:attribute name="onclick">javascript:NewItem2(event, "/_layouts/listform.aspx?PageType=8&ListId={}&RootFolder=");javascript:return false;</xsl:attribute> <xsl:attribute name="href">/_layouts/listform.aspx?PageType=8&ListId={}&RootFolder=</xsl:attribute>Add new announcement</a>
    </div>
</xsl:if>


From C:\Program Files\Microsoft Office\Office14\CAML2XSL.XSL:

 <!-- keep in sync with global.cs!!!
     EmptyMask               =0x0000000000000000,
        // list/document perms  =0x000000000000XXXX,
        ViewListItems           =0x0000000000000001,
        AddListItems            =0x0000000000000002,
        EditListItems           =0x0000000000000004,
        DeleteListItems         =0x0000000000000008,
        ApproveItems            =0x0000000000000010,
        OpenItems               =0x0000000000000020,
        ViewVersions            =0x0000000000000040,
        DeleteVersions          =0x0000000000000080,
        CancelCheckout          =0x0000000000000100,
        ManagePersonalViews     =0x0000000000000200,
        // UnusedList10         =0x0000000000000400, /* obsolete ManageListPermission */
        ManageLists             =0x0000000000000800,
        ViewFormPages           =0x0000000000001000,
        // UnusedList20         =0x0000000000002000,
        // UnusedList40         =0x0000000000004000,
        // UnusedList80         =0x0000000000008000,
        // web level perms      =0x0000XXXXXXXX0000,
        Open                    =0x0000000000010000,
        ViewPages               =0x0000000000020000,
        AddAndCustomizePages    =0x0000000000040000,
        ApplyThemeAndBorder     =0x0000000000080000,
        ApplyStyleSheets        =0x0000000000100000,
        ViewUsageData           =0x0000000000200000,
        CreateSSCSite           =0x0000000000400000,
        ManageSubwebs           =0x0000000000800000,
        CreateGroups            =0x0000000001000000,
        ManagePermissions       =0x0000000002000000,
        BrowseDirectories       =0x0000000004000000,
        BrowseUserInfo          =0x0000000008000000,
        AddDelPrivateWebParts   =0x0000000010000000,
        UpdatePersonalWebParts  =0x0000000020000000,
        ManageWeb               =0x0000000040000000,
        UseRemoteAPIs           =0x0000002000000000,
        ManageAlerts            =0x0000004000000000,
        CreateAlerts            =0x0000008000000000,
        EditMyUserInfo          =0x0000010000000000,
       
        // special perms        =0xXXXX000000000000,
        EnumeratePermissions    =0x4000000000000000,
        // end of list
        FullMask                =0x7FFFFFFFFFFFFFFF,
 -->

Resources:
http://sharepoint.indigoreality.com/2012/05/04/sharepoint-2010-ifhasrightspermissionmask/
SPBasePermissions enumeration