適用場景:html
三個列表進行Join,而後試圖上顯示ProjectedField,而ProjectedField不支持設置DisplayName.默認只能顯示英文名。web
join caml以下:緩存
<View> <Query> <OrderBy> <FieldRef Name="ID" /> </OrderBy> </Query> <ViewFields> <FieldRef Name="Attachments" /> <FieldRef Name="LinkTitle" /> <FieldRef Name="FirstName" /> <FieldRef Name="Company" /> <FieldRef Name="WorkPhone" /> <FieldRef Name="HomePhone" /> <FieldRef Name="Email" /> <FieldRef Name="TuMuLookup" /> <FieldRef Name="ZhuanYe" /> </ViewFields> <Joins> <Join Type="LEFT" ListAlias="TuMu"> <Eq> <FieldRef Name="TuMuLookup" RefType="ID" /> <FieldRef List="TuMu" Name="ID" /> </Eq> </Join> <Join Type="LEFT" ListAlias="ZhuanYe"> <Eq> <FieldRef List="TuMu" Name="ZhuanYeLookup" RefType="Id" /> <FieldRef List="ZhuanYe" Name="ID" /> </Eq> </Join> </Joins> <ProjectedFields> <Field List="ZhuanYe" Type="Lookup" Name="ZhuanYe" ShowField="Title" /> </ProjectedFields> <XslLink Default="TRUE">main.xsl</XslLink> <RowLimit Paged="TRUE">30</RowLimit> <Toolbar Type="Standard" /> </View>
解決方法:app
採用自定義xsl來解決。this
1)在layouts/xsl下增長一個xsl文件:xsl_zhuanye.xslorm
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal"> <xsl:output method="html" indent="no" encoding="uft-8" /> <xsl:include href="/_layouts/xsl/main.xsl" /> <xsl:include href="/_layouts/xsl/internal.xsl" /> <xsl:decimal-format NaN="" /> <xsl:template match="/"> <xsl:apply-templates mode="RootTemplate" select="$XmlDefinition" /> <hr/> </xsl:template> <xsl:template name="FieldRef_header.ZhuanYe" match="FieldRef[@Name='ZhuanYe']" mode="header"> <th nowrap="" scope="col" onmouseover="OnChildColumn(this)" class="ms-vh2"> <div class="ms-vh-div"> 專業 </div> </th> </xsl:template> </xsl:stylesheet>
備註:<xsl:template match="/"> 模板能夠刪掉xml
2)修改列表webpart屬性,這是其Xsl連接爲/_layouts/xsl/xsl_zhuanye.xslhtm
3)iisreset清除視圖xsl緩存。blog