I am working on a project and I need to create a multi sheet excel file using classic asp.
Here is my code. It makes a multi sheet excel but I cant write anything on sheet 2 or 3:
<%
response.charset = "UTF-8"
Response.Buffer=true
Response.AddHeader "Content-Disposition", "attachment;filename=aaa.xls"
Response.ContentType = "application/vnd.ms-excel"
%>
<HTML xmlns:x="urn:schemas-microsoft-com:office:excel">
<HEAD>
<xml>
<x:ExcelWorkbook>
<x:ExcelWorksheets>
<x:ExcelWorksheet>
<x:Name>sheet1</x:Name>
<x:WorksheetOptions>
<x:Print>
<x:ValidPrinterInfo>
</x:Print>
</x:WorksheetOptions>
</x:ExcelWorksheet>
<x:ExcelWorksheet>
<x:Name>sheet2</x:Name>
<x:WorksheetOptions>
<x:Print>
<x:ValidPrinterInfo>
</x:Print>
</x:WorksheetOptions>
</x:ExcelWorksheet>
</x:ExcelWorksheets>
</x:ExcelWorkbook>
</xml>
</HEAD>
<BODY>
<TABLE>
<%
dim oConn
Set oConn = Server.CreateObject("ADODB.Connection")
Dim rs, ds
Set rs = Server.CreateObject("ADODB.Recordset")
Response.Write "<tr>"
Response.Write "<td style='border-left:none;border:.5pt solid windowtext;' bgcolor='#CCCCCC' bordercolor='#000000'><b>"
Response.Write "aa"
Response.Write "</b></td>"
Response.Write "</tr>"
Response.Write "<tr>"
Response.Write "<td>"
Response.Write "bb"
Response.Write "</td>"
Response.Write "</tr>"
%>
</TABLE>
</BODY>
</HTML>
I don't think it's possible to create actual .xls / .xlsx files in Classic ASP without a third party component (such as EasyXLS.ExcelDocument).
But what you can do is generate your Excel file using XML markup within Classic ASP, export it with a .xls extension and Excel will convert the file when you open it (after a warning message).
For example:
<%#LANGUAGE="VBSCRIPT" CODEPAGE="65001"%>
<%
Response.Charset = "UTF-8"
Response.AddHeader "Content-Disposition", "attachment;filename=aaa.xls"
Response.ContentType = "application/vnd.ms-excel"
%><?xml version="1.0"?>
<?mso-application progid="Excel.Sheet"?>
<Workbook xmlns="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:o="urn:schemas-microsoft-com:office:office"
xmlns:x="urn:schemas-microsoft-com:office:excel"
xmlns:ss="urn:schemas-microsoft-com:office:spreadsheet"
xmlns:html="http://www.w3.org/TR/REC-html40">
<DocumentProperties xmlns="urn:schemas-microsoft-com:office:office">
<Author>Author Name</Author>
<LastAuthor>Author Name</LastAuthor>
<Created>2020-05-20T13:19:37Z</Created>
<LastSaved>2020-05-20T13:21:04Z</LastSaved>
<Company>Company Name</Company>
<Version>14.00</Version>
</DocumentProperties>
<OfficeDocumentSettings xmlns="urn:schemas-microsoft-com:office:office">
<AllowPNG/>
</OfficeDocumentSettings>
<ExcelWorkbook xmlns="urn:schemas-microsoft-com:office:excel">
<WindowHeight>4695</WindowHeight>
<WindowWidth>14355</WindowWidth>
<WindowTopX>360</WindowTopX>
<WindowTopY>105</WindowTopY>
<ActiveSheet>2</ActiveSheet>
<ProtectStructure>False</ProtectStructure>
<ProtectWindows>False</ProtectWindows>
</ExcelWorkbook>
<Styles>
<Style ss:ID="Default" ss:Name="Normal">
<Alignment ss:Vertical="Bottom"/>
<Borders/>
<Font ss:FontName="Calibri" x:Family="Swiss" ss:Size="11" ss:Color="#000000"/>
<Interior/>
<NumberFormat/>
<Protection/>
</Style>
</Styles>
<Worksheet ss:Name="Sheet1">
<Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"
x:FullRows="1" ss:DefaultRowHeight="15">
<Row>
<Cell><Data ss:Type="String">1A - Sheet 1</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<PageSetup>
<Header x:Margin="0.3"/>
<Footer x:Margin="0.3"/>
<PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
</PageSetup>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name="Sheet2">
<Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"
x:FullRows="1" ss:DefaultRowHeight="15">
<Row>
<Cell><Data ss:Type="String">1A - Sheet 2</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<PageSetup>
<Header x:Margin="0.3"/>
<Footer x:Margin="0.3"/>
<PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
</PageSetup>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
<Worksheet ss:Name="Sheet3">
<Table ss:ExpandedColumnCount="1" ss:ExpandedRowCount="1" x:FullColumns="1"
x:FullRows="1" ss:DefaultRowHeight="15">
<Row>
<Cell><Data ss:Type="String">1A - Sheet 3</Data></Cell>
</Row>
</Table>
<WorksheetOptions xmlns="urn:schemas-microsoft-com:office:excel">
<PageSetup>
<Header x:Margin="0.3"/>
<Footer x:Margin="0.3"/>
<PageMargins x:Bottom="0.75" x:Left="0.7" x:Right="0.7" x:Top="0.75"/>
</PageSetup>
<Selected/>
<Panes>
<Pane>
<Number>3</Number>
<ActiveRow>6</ActiveRow>
<ActiveCol>3</ActiveCol>
</Pane>
</Panes>
<ProtectObjects>False</ProtectObjects>
<ProtectScenarios>False</ProtectScenarios>
</WorksheetOptions>
</Worksheet>
</Workbook>
The above example has 3 populated sheets. Best thing to do would be to create a dummy template of the type of Excel layout you're looking to generate, populate the sheets with dummy data and export from Excel using the "XML Spreadsheet" format (which is all I did for the above example). Then use Classic ASP to replace the dummy data with actual data.
I am trying to extract few tags using XSLT , but tags are getting blank value. Can you please suggest what is the issue with the code.
Below is my code :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th style="text-align:left">ClientID</th>
<th style="text-align:left">AssetClass</th>
</tr>
<tr>
<td><xsl:value-of select="ClientID"/></td>
<td><xsl:value-of select="AssetClass"/></td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
Below is the XML from which I am trying to pull the data.
<?xml version="1.0"?>
<template123 xmlns="http://www.markit.com/totem/api/data/V40" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ClientID>470</ClientID>
<ValuationDate>2019-01-31</ValuationDate>
<AssetClass>Value</AssetClass>
<ServiceName>Oil</ServiceName>
<ServiceFrequency>ME</ServiceFrequency>
<SubArea>10</SubArea>
<SchemaVersion>40</SchemaVersion>
<Underlier>
<ContractGroup>Chemicals</ContractGroup>
<Currency>USD</Currency>
<ReferencePublication1>XYZ</ReferencePublication1>
<Underlying>ABC</Underlying>
<Underlying1>ABC</Underlying1>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-02-28</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-02-01</StartDate>
<Units>MT</Units>
<ClientPrice>472.84000000</ClientPrice>
</Instrument>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-03-31</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-03-01</StartDate>
<Units>MT</Units>
<ClientPrice>456.46600000</ClientPrice>
</Instrument>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-04-30</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-04-01</StartDate>
<Units>MT</Units>
<ClientPrice>440.30900000</ClientPrice>
</Instrument>
</Underlier>
</template123>
Have tried with the suggested solution and able to get the parent nodes values but nested node is still coming as blank.
My Updated Code :
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ab="http://www.markit.com/totem/api/data/V40">
<xsl:output method="text" />
<xsl:template match="ab:template">
<xsl:text>ClientID|ValuationDate|AssetClass|ServiceName|ServiceFrequency|SubArea|SchemaVersion|ContractGroup|EndDate</xsl:text>
<xsl:text>
</xsl:text>
<xsl:value-of select="ab:ClientID" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ValuationDate" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:AssetClass" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ServiceName" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ServiceFrequency" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:SubArea" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:SchemaVersion" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:Underlier/ContractGroup" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:Underlier/Instrument/EndDate" />
<xsl:text>|</xsl:text>
</xsl:template>
</xsl:stylesheet>
I am trying to extract the data from this XML and convert it into a pipe separated file.
Can you suggest what needs to be changed to access the values from nested nodes.
Expected output should look like as below :
ClientID|ValuationDate|AssetClass|ServiceName|ServiceFrequency|SubArea|SchemaVersion|ContractGroup|EndDate
470|2019-01-31|Value|Oil|ME|10|40|Chemicals|2019-02-28
470|2019-01-31|Value|Oil|ME|10|40|Chemicals|2019-03-31
and so on for all nested nodes.
You can try this
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:ab="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="ab">
<xsl:template match="ab:template123">
<html>
<body>
<h2>My Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th style="text-align:left">ClientID</th>
<th style="text-align:left">AssetClass</th>
</tr>
<tr>
<td><xsl:value-of select="ab:ClientID"/></td>
<td><xsl:value-of select="ab:AssetClass"/></td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
DEMO
https://xsltfiddle.liberty-development.net/94AbWB2
XML File:
<?xml version="1.0" encoding="UTF-8"?>
<template123 xmlns="http://www.markit.com/totem/api/data/V40" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
<ClientID>470</ClientID>
<ValuationDate>2019-01-31</ValuationDate>
<AssetClass>Value</AssetClass>
<ServiceName>Oil</ServiceName>
<ServiceFrequency>ME</ServiceFrequency>
<SubArea>10</SubArea>
<SchemaVersion>40</SchemaVersion>
<Underlier>
<ContractGroup>Chemicals</ContractGroup>
<Currency>USD</Currency>
<ReferencePublication1>XYZ</ReferencePublication1>
<Underlying>ABC</Underlying>
<Underlying1>ABC</Underlying1>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-02-28</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-02-01</StartDate>
<Units>MT</Units>
<ClientPrice>472.84000000</ClientPrice>
</Instrument>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-03-31</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-03-01</StartDate>
<Units>MT</Units>
<ClientPrice>456.46600000</ClientPrice>
</Instrument>
<Instrument>
<CCYScalar>1.0</CCYScalar>
<EndDate>2019-04-30</EndDate>
<InstrumentType>Watch</InstrumentType>
<InstrumentType1>Watch</InstrumentType1>
<Period>Month</Period>
<PricingTime>LDN 16:30</PricingTime>
<StartDate>2019-04-01</StartDate>
<Units>MT</Units>
<ClientPrice>440.30900000</ClientPrice>
</Instrument>
</Underlier>
</template123>
XSLT:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:ab="http://www.markit.com/totem/api/data/V40">
<xsl:output method="text" />
<xsl:template match="ab:template123">
<xsl:text>ClientID|ValuationDate|AssetClass|ServiceName|ServiceFrequency|SubArea|SchemaVersion|ContractGroup|EndDate</xsl:text>
<xsl:text>
</xsl:text>
<xsl:value-of select="ab:ClientID" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ValuationDate" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:AssetClass" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ServiceName" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:ServiceFrequency" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:SubArea" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:SchemaVersion" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:Underlier/ab:ContractGroup" />
<xsl:text>|</xsl:text>
<xsl:value-of select="ab:Underlier/ab:Instrument/ab:EndDate" />
</xsl:template>
</xsl:stylesheet>
OUTPUT:
ClientID|ValuationDate|AssetClass|ServiceName|ServiceFrequency|SubArea|SchemaVersion|ContractGroup|EndDate
470|2019-01-31|Value|Oil|ME|10|40|Chemicals|2019-02-28
Look like two things are wrong in you scenario:
Default NameSpace in XML is exact match with transformation namespace
In match context you are on document node so either you need to use template123 in match or in <xsl:value-of select="template123/ClientID"/> & <xsl:value-of select="template123/AssetClass"/> you give the proper path to navigate the elements.
Below is the code you can use:
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<html>
<body>
<h2>My Collection</h2>
<table border="1">
<tr bgcolor="#9acd32">
<th style="text-align:left">ClientID</th>
<th style="text-align:left">AssetClass</th>
</tr>
<tr>
<td><xsl:value-of select="template123/ClientID"/></td>
<td><xsl:value-of select="template123/AssetClass"/></td>
</tr>
</table>
</body>
</html>
</xsl:template>
</xsl:stylesheet>
You can see this link for your reference:
https://xsltfiddle.liberty-development.net/6rewNxZ/1
I want to convert all child node as attribute name to Nodes. and attribute value should be the node value.
How do i give dynamic node name?
<xsl:attribute name="shouldBeNodeName">
SOURCE XML
<transaction>
<transactionId>T001</transactionId>
<clientId>C001</clientId>
<contractId>C001</contractId>
<scriptId>REL</scriptId>
<price>500.5000</price>
<tradeDate>2019-02-09 16:00:00</tradeDate>
<valueDate>2019-02-09 16:00:00</valueDate>
<quantity>100000</quantity>
</transaction>
XSLT
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ROOT>
<TRANS>
<xsl:for-each select="node()/*">
<xsl:attribute name="shouldBeNodeName">
<!-- <xsl:value-of select="name()" /> -->
<xsl:value-of select="." />
</xsl:attribute>
</xsl:for-each>
</TRANS>
</ROOT>
</xsl:template>
</xsl:stylesheet>
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="3.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:template match="/">
<ROOT>
<TRANS>
<xsl:for-each select="node()/*">
<xsl:attribute name="{name()}">
<xsl:value-of select="." />
</xsl:attribute>
</xsl:for-each>
</TRANS>
</ROOT>
</xsl:template>
Why can I use fields in LayoutXml that are not in the FetchXml?
I would have thought that to use a field in the LayoutXml it would have to be in the FetchXml, but this works:
<layoutxml>
<grid name="resultset" object="112" jump="title" select="1" icon="1" preview="1">
<row name="result" id="incidentid">
<cell name="title" width="150" />
<cell name="ticketnumber" width="150" />
<cell name="prioritycode" width="150" />
<cell name="createdon" width="150" />
<cell name="plate_businessunit" width="100" />
<cell name="ownerid" width="100" />
<cell name="createdby" width="100" />
<cell name="plate_acknowledgeby" width="100" />
<cell name="followupby" width="100" />
<cell name="a_4b5945b8a4a64613afc1ae1d5e6828c7.name" width="100" />
<cell name="a_4b5945b8a4a64613afc1ae1d5e6828c7.plate_classification" width="150" />
</row>
</grid>
</layoutxml>
<querytype>0</querytype>
<fetchxml>
<fetch version="1.0" output-format="xml-platform" mapping="logical">
<entity name="incident">
<order attribute="title" descending="false" />
<link-entity alias="a_4b5945b8a4a64613afc1ae1d5e6828c7" name="account" from="accountid" to="customerid" link-type="outer" visible="false">
<attribute name="name" />
<attribute name="plate_classification" />
</link-entity>
</entity>
</fetch>
</fetchxml>
<LocalizedNames>
<LocalizedName description="All Cases" languagecode="1033" />
</LocalizedNames>
</savedquery>
Probably because by specifying the field in the layout XML CRM automatically returns those fields.
I wonder if anyone out there could help.
I'm new to Xpath & SharePoint 2010 but so far I have been getting along, but this little problem is causing me a big head ache!
What i'm trying to do is show the value in a field if there is not another value with a similar name in the same column in a SharePoint list (hopefully that makes sense).
I have the following select which works if you hard code the value to compare against
<xsl:value-of select="$thisNode/#Txt_x0020_Doc_x0020_Ref[contains(.,'Test')]"/> This will displays all values that have test in this case.
What i'm after is to compare the current selected Txt_x0020_Doc_x0020_Ref column against all other results in the Txt_x0020_Doc_x0020_Ref columns
If someone could point me in the right direction that would be amazing!
*Update #Ian Here is the entire contents of the page in share point designer.
What I want it to do is remove the duplicate naming values and show the top value only i.e.
Current list
Test 1
Test 1
Hello 1
Robert 1
What I want
Test 1
Hello 1
Robert 1
Just to give a bit more information on the purpose of the SharePoint list. It is a form library that stores inputted forms, all the forms are submitted so every version is kept, The purpose of the view below is to show the latest version of the form only, then I will have another view which will show the other versions.
Please find the complete code from sharepoint designer below:
<code>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitle" runat="server">
<SharePoint:ListProperty Property="TitleOrFolder" runat="server"/> -
<SharePoint:ListProperty Property="CurrentViewTitle" runat="server"/></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageTitleInTitleArea" runat="server">
<SharePoint:ListProperty Property="TitleBreadcrumb" runat="server"/>
<SharePoint:UIVersionedContent UIVersion="4" runat="server">
<ContentTemplate>
<span class="ms-ltviewselectormenuheader" runat="server">
<SharePoint:ListTitleViewSelectorMenu AlignToParent="true" id="LTViewSelectorMenu" runat="server" />
</span>
</ContentTemplate>
</SharePoint:UIVersionedContent>
</asp:Content>
<asp:content contentplaceholderid="PlaceHolderAdditionalPageHead" runat="server">
<SharePoint:RssLink runat="server"/>
</asp:content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageImage" runat="server">
<SharePoint:ViewIcon Width="145" Height="54" runat="server"/></asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderLeftActions" runat="server">
<SharePoint:RecentChangesMenu runat="server" id="RecentChanges"/>
<SharePoint:ModifySettingsLink runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId ="PlaceHolderBodyLeftBorder" runat="server">
<div height="100%" class="ms-pagemargin"><img src="/_layouts/images/blank.gif" width='6' height='1' alt="" /></div>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderMain" runat="server">
<WebPartPages:WebPartZone runat="server" FrameType="None" ID="Main" Title="loc:Main"><ZoneTemplate>
<WebPartPages:XsltListViewWebPart runat="server" Description="" PartOrder="2" Default="TRUE" HelpLink="" AllowRemove="True" IsVisible="True" AllowHide="True" UseSQLDataSourcePaging="True" ExportControlledProperties="False" IsIncludedFilter="" DataSourceID="" Title="Demand Management" ViewFlag="5" AllowConnect="True" DisplayName="Main View" PageType="PAGE_DEFAULTVIEW" FrameState="Normal" PageSize="-1" PartImageLarge="" AsyncRefresh="False" ExportMode="NonSensitiveData" Dir="Default" DetailLink="/Strategy-and-Architecture/Business-Account-Managers/Demand Management" ShowWithSampleData="False" ListId="cafbbdc7-079d-4ae1-bf40-4a695834e510" ListName="{CAFBBDC7-079D-4AE1-BF40-4A695834E510}" FrameType="Default" PartImageSmall="" IsIncluded="True" SuppressWebPartChrome="False" AllowEdit="True" ViewGuid="{1766D7BE-7DC0-4277-8418-EBA815716C60}" AutoRefresh="False" AutoRefreshInterval="60" AllowMinimize="True" WebId="00000000-0000-0000-0000-000000000000" ViewContentTypeId="0x" InitialAsyncDataFetch="False" GhostedXslLink="main.xsl" MissingAssembly="Cannot import this Web Part." HelpMode="Modeless" ID="g_1766d7be_7dc0_4277_8418_eba815716c60" ConnectionID="00000000-0000-0000-0000-000000000000" AllowZoneChange="True" TitleUrl="/Strategy-and-Architecture/Business-Account-Managers/Demand Management" ManualRefresh="False" __MarkupType="vsattributemarkup" __WebPartId="{1766D7BE-7DC0-4277-8418-EBA815716C60}" __AllowXSLTEditing="true" __designer:CustomXsl="fldtypes_Ratings.xsl" WebPart="true" Height="" Width=""><ParameterBindings>
<ParameterBinding Name="dvt_sortdir" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_sortfield" Location="Postback;Connection"/>
<ParameterBinding Name="dvt_startposition" Location="Postback" DefaultValue=""/>
<ParameterBinding Name="dvt_firstrow" Location="Postback;Connection"/>
<ParameterBinding Name="OpenMenuKeyAccessible" Location="Resource(wss,OpenMenuKeyAccessible)" />
<ParameterBinding Name="open_menu" Location="Resource(wss,open_menu)" />
<ParameterBinding Name="select_deselect_all" Location="Resource(wss,select_deselect_all)" />
<ParameterBinding Name="idPresEnabled" Location="Resource(wss,idPresEnabled)" />
<ParameterBinding Name="NoAnnouncements" Location="Resource(wss,noitemsinview_doclibrary)" />
<ParameterBinding Name="NoAnnouncementsHowTo" Location="Resource(wss,noitemsinview_doclibrary_howto2)" />
</ParameterBindings>
<XmlDefinition>
<View Name="{1766D7BE-7DC0-4277-8418-EBA815716C60}" DefaultView="TRUE" Type="HTML" DisplayName="Main View" Url="/Strategy-and-Architecture/Business-Account-Managers/Demand Management/Forms/Main View.aspx" Level="1" BaseViewID="1" ContentTypeID="0x" ImageUrl="/_layouts/images/dlicon.png">
<Query/>
<ViewFields>
<FieldRef Name="LinkFilename"/>
<FieldRef Name="Txt_x0020_Doc_x0020_Ref"/>
<FieldRef Name="Txtdescription"/>
<FieldRef Name="Txt_x0020_Doc_x0020_Status_x0020_Hidden"/>
<FieldRef Name="Ddl_x0020_DM_x0020_Project_x0020_Status"/>
<FieldRef Name="Modified"/>
<FieldRef Name="Editor"/>
<FieldRef Name="Txt_x0020_Version"/>
<FieldRef Name="Title" Explicit="TRUE"/>
</ViewFields>
<RowLimit Paged="TRUE">30</RowLimit>
<Toolbar Type="Standard"/>
</View>
</XmlDefinition>
<DataFields>
</DataFields>
<Xsl>
<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" xmlns:o="urn:schemas-microsoft-com:office:office">
<xsl:include href="/_layouts/xsl/main.xsl"/>
<xsl:include href="/_layouts/xsl/internal.xsl"/>
<xsl:param name="AllRows" select="/dsQueryResponse/Rows/Row[$EntityName = '' or (position() >= $FirstRow and position() <= $LastRow)]"/>
<xsl:param name="dvt_apos">'</xsl:param>
<xsl:template match="FieldRef[#Name='LinkFilename']" name="LinkFilenameNoMenu.LinkFilename" mode="Computed_LinkFilename_body" ddwrt:tag="a" ddwrt:dvt_mode="body" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal">
<xsl:param name="thisNode" select="."/>
<xsl:param name="ShowAccessibleIcon" select="0"/>
<xsl:param name="folderUrlAdditionalQueryString"/>
<xsl:param name="IncludeOnClick" select="1"/>
<xsl:choose>
<xsl:when test="$thisNode/#FSObjType='1'">
<xsl:choose>
<xsl:when test="$RecursiveView">
<xsl:value-of select="$thisNode/#FileLeafRef" />
</xsl:when>
<xsl:otherwise>
<xsl:variable name="FolderURL">
<xsl:value-of select="$PagePathFinal" />RootFolder=<xsl:value-of select="$thisNode/#FileRef.urlencode" /><xsl:value-of select="$ShowWebPart"/>&FolderCTID=<xsl:value-of select="$thisNode/#ContentTypeId" />&View=<xsl:value-of select="$View"/><xsl:value-of select="$folderUrlAdditionalQueryString"/>
</xsl:variable>
<xsl:choose>
<xsl:when test="$IsDocLib">
<xsl:variable name="OnMouseDownJS">
javascript:VerifyFolderHref(this,event,'<xsl:value-of select="$thisNode/#File_x0020_Type.url" />','<xsl:value-of select="$thisNode/#File_x0020_Type.progid" />','<xsl:value-of select="$XmlDefinition/List/#DefaultItemOpen" />','<xsl:value-of select="$thisNode/#HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon" />','<xsl:value-of select="$thisNode/#HTML_x0020_File_x0020_Type" />','<xsl:value-of select="$thisNode/#serverurl.progid" />');return false;
</xsl:variable>
<xsl:variable name="OnClickJS">
return HandleFolder(this,event,"<xsl:value-of select="$PagePathFinal" />RootFolder=" + escapeProperly("<xsl:value-of select="$thisNode/#FileRef" />") + '<xsl:value-of select="$ShowWebPart" />&FolderCTID=<xsl:value-of select="$thisNode/#ContentTypeId" />&View=<xsl:value-of select="$View" /><xsl:value-of select="$folderUrlAdditionalQueryString"/>','TRUE','FALSE','<xsl:value-of select="$thisNode/#File_x0020_Type.url" />','<xsl:value-of select="$thisNode/#File_x0020_Type.progid" />','<xsl:value-of select="$XmlDefinition/List/#DefaultItemOpen" />','<xsl:value-of select="$thisNode/#HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon" />','<xsl:value-of select="$thisNode/#HTML_x0020_File_x0020_Type" />','<xsl:value-of select="$thisNode/#serverurl.progid" />','<xsl:value-of select="$thisNode/#CheckoutUser.id" />','<xsl:value-of select="$Userid" />','<xsl:value-of select="$XmlDefinition/List/#ForceCheckout" />','<xsl:value-of select="$thisNode/#IsCheckedoutToLocal" />','<xsl:value-of select="$thisNode/#PermMask" />');
</xsl:variable>
<a onfocus="OnLink(this)" href="{$FolderURL}">
<xsl:choose>
<xsl:when test="$IncludeOnClick = '1'">
<xsl:attribute name="onmousedown">
<xsl:value-of select="$OnMouseDownJS"/>
</xsl:attribute>
<xsl:attribute name="onclick">
<xsl:value-of select="$OnClickJS"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:value-of select="$thisNode/#FileLeafRef" />
<xsl:choose>
<xsl:when test="$ShowAccessibleIcon">
<img src="/_layouts/images/blank.gif" class="ms-hidden" border="0" width="1" height="1" alt="{$idPresEnabled}" />
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</a>
</xsl:when>
<xsl:otherwise>
<xsl:variable name="OnClickJS">
javascript:EnterFolder("<xsl:value-of select="$PagePathFinal" />RootFolder=" + escapeProperly("<xsl:value-of select="$thisNode/#FileRef" />") + '<xsl:value-of select="$ShowWebPart" />&FolderCTID=<xsl:value-of select="$thisNode/#ContentTypeId" />&View=<xsl:value-of select="$View" /><xsl:value-of select="$folderUrlAdditionalQueryString" />');return false;
</xsl:variable>
<a onfocus="OnLink(this)" href="{$FolderURL}">
<xsl:choose>
<xsl:when test="$IncludeOnClick = '1'">
<xsl:attribute name="onclick">
<xsl:value-of select="$OnClickJS"/>
</xsl:attribute>
</xsl:when>
</xsl:choose>
<xsl:value-of select="$thisNode/#FileLeafRef" />
<xsl:choose>
<xsl:when test="$ShowAccessibleIcon">
<img src="/_layouts/images/blank.gif" class="ms-hidden" border="0" width="1" height="1" alt="{$idPresEnabled}" />
</xsl:when>
<xsl:otherwise></xsl:otherwise>
</xsl:choose>
</a>
</xsl:otherwise>
</xsl:choose>
</xsl:otherwise>
</xsl:choose>
</xsl:when>
<xsl:otherwise>
<a onfocus="OnLink(this)" href="{$thisNode/#FileRef}" onmousedown="return VerifyHref(this,event,'{$XmlDefinition/List/#DefaultItemOpen}','{$thisNode/#HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/#serverurl.progid}')"
onclick="return DispEx(this,event,'TRUE','FALSE','{$thisNode/#File_x0020_Type.url}','{$thisNode/#File_x0020_Type.progid}','{$XmlDefinition/List/#DefaultItemOpen}','{$thisNode/#HTML_x0020_File_x0020_Type.File_x0020_Type.mapcon}','{$thisNode/#HTML_x0020_File_x0020_Type}','{$thisNode/#serverurl.progid}','{$thisNode/#CheckoutUser.id}','{$Userid}','{$XmlDefinition/List/#ForceCheckout}','{$thisNode/#IsCheckedoutToLocal}','{$thisNode/#PermMask}')">
<xsl:value-of select="/dsQueryResponse/Rows/Row[1]" />
<xsl:value-of select="$thisNode/#FileLeafRef.Name" /></a>
<xsl:if test="$thisNode/#Created_x0020_Date.ifnew='1'">
<xsl:call-template name="NewGif">
<xsl:with-param name="thisNode" select="$thisNode"/>
</xsl:call-template>
</xsl:if>
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name="FieldRef_Text_body.Txt_x0020_Doc_x0020_Ref" ddwrt:dvt_mode="body" match ="FieldRef[#Name='Txt_x0020_Doc_x0020_Ref']" mode="Text_body" ddwrt:ghost="" xmlns:ddwrt2="urn:frontpage:internal">
<xsl:param name="thisNode" select="."/>
<!--- This is the field I wish to change --->
<xsl:value-of select="$thisNode/#Txt_x0020_Doc_x0020_Ref[contains(.,'Test')]"/>
</xsl:template></xsl:stylesheet></Xsl>
</WebPartPages:XsltListViewWebPart>
</ZoneTemplate></WebPartPages:WebPartZone>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderBodyAreaClass" runat="server">
<style type="text/css">
.ms-bodyareaframe {
padding: 0px;
}
</style>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderPageDescription" runat="server">
<SharePoint:ListProperty CssClass="ms-listdescription" Property="Description" runat="server"/>
</asp:Content>
<asp:Content ContentPlaceHolderId="PlaceHolderCalendarNavigator" runat="server">
<SharePoint:SPCalendarNavigator id="CalendarNavigatorId" runat="server"/>
<ApplicationPages:CalendarAggregationPanel id="AggregationPanel" runat="server"/>
</asp:Content>
</code>
On the tables select statement change the "AllRows" select statement to the following
This will then display only one result of the same document name, then add a order by clause in the xml as show below to display the latest result.
<Query>
<OrderBy>
<FieldRef Name="Modified" Ascending="FALSE"/>
</OrderBy>
<GroupBy>
</GroupBy>
</Query>