Hello..
I have a forms and list for departmental meeting minutes. I was wondering if it's possible to group by multiple items. I've tried but have been unable to get this working properly.
For example, I have four different departments, so I need the minutes grouped by departments; this isn't a problem. I can also create an XSL sheet which groups the items by month and year.
But, I need to group these meeting minutes first by departments and then by the month and year the meetings occurred. E.g.:
Board of Trustees
January 2011
January 1st, 2011
January 5th, 2011
February 2011
February 3rd, 2011
February 7th, 2011
Zoning Commission
January 2011
January 3rd, 2011
January 7th, 2011
February 2011
February 9th, 2011
February 1th, 2011
Any help would be appreciated. Thanks.. -Jeff
What I have thus far (this doesn't work):
<?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="yes" omit-xml-declaration="yes" />
<!--
This prefix is used to generate module specific query strings
Each querystring or form value that starts with udt_{ModuleId}_param
will be added as parameter starting with param
-->
<xsl:variable name="prefix_param">udt_<xsl:value-of select="//udt:Context/udt:ModuleId" />_param</xsl:variable>
<xsl:key name="data-by-department" match="udt:Data" use="udt:Department" />
<xsl:key name="data-by-date" match="udt:Data" use="udt:Month_x0020_and_x0020_Year" />
<xsl:template match="udt:Data" mode="list">
<li>
<xsl:call-template name="EditLink" />
<xsl:value-of select="udt:Minutes" disable-output-escaping="yes" />
</li>
</xsl:template>
<xsl:template match="/udt:UserDefinedTable">
<ul style="padding-top: 15px;">
<xsl:for-each select="udt:Data[count(. | key('data-by-department', udt:Department)[1]) = 1]">
<li>
<xsl:value-of select="udt:Department" disable-output-escaping="yes" />&160;MINUTES
<ul>
<li>
<xsl:for-each select="udt:Data[count(. | key('data-by-date', udt:Month_x0020_and_x0020_Year)[1]) = 1]">
<xsl:variable name="currentData" select="key('data-by-date', udt:Month_x0020_and_x0020_Year)" />
<xsl:apply-templates select="$currentData" mode="list">
</xsl:apply-templates>
</xsl:for-each>
</li>
</ul>
</li>
</xsl:for-each>
</ul>
</xsl:template>
<xsl:template name="EditLink">
<xsl:if test="udt:EditLink">
<a href="{udt:EditLink}">
<img border="0" alt="edit" src="{//udt:Context/udt:ApplicationPath}/images/edit.gif" />
</a>
</xsl:if>
</xsl:template>
</xsl:stylesheet>