Products

Solutions

Resources

Partners

Community

Blog

About

QA

Ideas Test

New Community Website

Ordinarily, you'd be at the right spot, but we've recently launched a brand new community website... For the community, by the community.

Yay... Take Me to the Community!

Welcome to the DNN Community Forums, your preferred source of online community support for all things related to DNN.
In order to participate you must be a registered DNNizen

HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListSort calculated columnSort calculated column
Previous
 
Next
New Post
2/16/2010 11:30 AM
 

 Hi,

Please can you help with this. I can't for the life get this sum column to sort descending like 23,17,12, (ascending doesn't work either) <xsl:value-of select="sum(//udt:Data[udt:Name=$name]/udt:Points)" disable-output-escaping="yes" />

I tried everything but this is just not working.

This is what I've got:

<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:udt="DotNetNuke/UserDefinedTable" exclude-result-prefixes="udt">
  <xsl:output method="xml" indent="no" omit-xml-declaration="yes" />
  <
  <xsl:key name="data-by-name" match="udt:Data" use="udt:Name" />
 
  <xsl:template match="udt:Data" mode="list">
    <html>
      <head>
                <tr CLASS="MYTABLE">
          <xsl:if test="position() mod 2 != 1">
            <xsl:attribute name="style">background-color:#dddddd</xsl:attribute>
          </xsl:if>
          <td CLASS="MYTABLE">
            <xsl:value-of select="position()" />
          </td>
          <td CLASS="MYTABLE">
            <xsl:value-of select="udt:Name" disable-output-escaping="yes" />
          </td>
          <td CLASS="MYTABLE">
            <xsl:value-of select="udt:Club" disable-output-escaping="yes" />
          </td>
          <td CLASS="MYTABLE">
            <xsl:value-of select="udt:Rating" disable-output-escaping="yes" />
          </td>
          <td CLASS="MYTABLE">
            <xsl:variable name="navn" select="udt:Name" />
            <xsl:value-of select="sum(//udt:Data[udt:Name=$name]/udt:Points)" disable-output-escaping="yes" />
          </td>
        </tr>
      </head>
      <body />
    </html>
  </xsl:template>

  <xsl:template match="/udt:UserDefinedTable">
    <xsl:variable name="currentData" select="udt:Data[count(. | key('data-by-name',udt:Name)[1]) = 1 and udt:Ratinggroup ='D-group']" />
    <xsl:if test="$currentData">
      <table class="MYTABLE" align="center">
        <CAPTION CLASS="MYTABLE">D-group</CAPTION>
        <tr CLASS="MYTABLE">
          <th CLASS="MYTABLE">Position</th>
          <th CLASS="MYTABLE">Name</th>
          <th CLASS="MYTABLE">Club</th>
          <th CLASS="MYTABLE">Rating</th>
          <th CLASS="MYTABLE">Points</th>
        </tr>
        <xsl:apply-templates select="$currentData" mode="list">
          <xsl:sort select="udt:Points" order="descending" data-type="number" />
        </xsl:apply-templates>
      </table>
    </xsl:if>
  </xsl:template>
</xsl:stylesheet>

 

Thank you in advance

 
New Post
2/16/2010 1:13 PM
 

Try

<xsl:sort select="sum(//udt:Data[udt:Name=$name]/udt:Points)" order="descending" data-type="number" />

instead of

<xsl:sort select="udt:Points" order="descending" data-type="number" />

 
New Post
2/17/2010 5:35 AM
 

Hi Stefan,

Unfortunately it doesn't work. Nothing happens when I use <xsl:sort select="sum(//udt:Data[udt:Name=$name]/udt:Points)" order="descending" data-type="number" />

There is no problem with sorting of the other columns. If there is no solution for this, I would like if you can write the SQL syntax for getting udt data not nesesserilly with filters from xsl I posted above, just clean syntax which I can use with Reports module to display data. I know a litlle bit more about sql than xml and xsl.

 
Previous
 
Next
HomeHomeDNN Open Source...DNN Open Source...Module ForumsModule ForumsForm and ListForm and ListSort calculated columnSort calculated column


These Forums are dedicated to discussion of DNN Platform and Evoq Solutions.

For the benefit of the community and to protect the integrity of the ecosystem, please observe the following posting guidelines:

  1. No Advertising. This includes promotion of commercial and non-commercial products or services which are not directly related to DNN.
  2. No vendor trolling / poaching. If someone posts about a vendor issue, allow the vendor or other customers to respond. Any post that looks like trolling / poaching will be removed.
  3. Discussion or promotion of DNN Platform product releases under a different brand name are strictly prohibited.
  4. No Flaming or Trolling.
  5. No Profanity, Racism, or Prejudice.
  6. Site Moderators have the final word on approving / removing a thread or post or comment.
  7. English language posting only, please.
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out
What is Liquid Content?
Find Out