Link to home
Start Free TrialLog in
Avatar of sullisnyc44
sullisnyc44Flag for United States of America

asked on

Reorder a data view wep part (DVWP)


MOSS 2007

I only have access to the page via Edit Page and editing the DVWP in the gui.
I cannot update the view either.

How can I reverse sort this?

<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:import href="/Style Library/XSL Style Sheets/webTest.xsl"></xsl:import>
	<xsl:output method="html" indent="no"/>
	<xsl:decimal-format NaN=""/>
	<xsl:param name="dvt_apos">'</xsl:param>
	<xsl:param name="Today">CurrentDate</xsl:param>
	<xsl:variable name="dvt_1_automode">0</xsl:variable>
	
	<xsl:template match="/" xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:SharePoint="Microsoft.SharePoint.WebControls">
		<xsl:call-template name="dvt_1"/>
	</xsl:template>
	
	<xsl:template name="dvt_1">
		<xsl:variable name="dvt_StyleName">Table</xsl:variable>
		<xsl:variable name="Rows" select="/dsQueryResponse/Rows/Row"/>
		<xsl:variable name="dvt_RowCount" select="count($Rows)" />
		<xsl:variable name="IsEmpty" select="$dvt_RowCount = 0" />

		
		<xsl:call-template name="dvt_1.body">
			<xsl:with-param name="Rows" select="$Rows"/>
			</xsl:call-template>	
<br/>
		</xsl:template>

		
	<xsl:template name="dvt_1.body">
		<xsl:param name="Rows"/>
		<xsl:variable name="GroupStyle" select="'UpcomingHeader'"/>
		<xsl:call-template name="UpcomingHeader" />

<xsl:if test="count($Rows)=0">
<p>There are currently no upcoming webinars. For recordings of past webinars, please use the links below.</p>
</xsl:if>
		
		<xsl:for-each select="$Rows">
			<xsl:variable name="Style" select="'Upcoming'"/>
					<xsl:call-template name="Upcoming" /></xsl:for-each>
	</xsl:template>
		
	</xsl:stylesheet>

Open in new window

Avatar of Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Flag of New Zealand image

Hello,

sorting takes place inside the xsl:for-each tag

		<xsl:for-each select="$Rows">
			<xsl:variable name="Style" select="'Upcoming'"/>
                        <xsl:sort select="@Title" order=”descending” />
			<xsl:call-template name="Upcoming" /></xsl:for-each>

Open in new window


Replace the "@Title" with the column you want to sort by.

cheers, teylyn
Avatar of sullisnyc44

ASKER

tells me to edit it in sharepoinnt designer. won't render.

forgot to mention that it's a publishing page
ASKER CERTIFIED SOLUTION
Avatar of Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Ingeborg Hawighorst (Microsoft MVP / EE MVE)
Flag of New Zealand image

Link to home
membership
This solution is only available to members.
To access this solution, you must be a member of Experts Exchange.
Start Free Trial