I am having a problem getting XSLT to work properly in the reports module when pulling data from a Form and List datasource.
DNN Site: 7.0.6
FNL module has two fields: Account, Amount.
I built an XLS file for the FNL module and it works fine. The intention is to subtotal all the Amounts for each Account.
However, with the limitation of 1 instance of FNL per page, there are different ways I want the data used so I put a a couple instances of the reports module on another page as well. On that page, I reference the same XSLT file, but the output does not look the same.
Within the FNL module I get:
Account 1 total
Account 2 total
Account 3 total etc.
Within the Reports module, I get:
Account 1totalAccount 2totalAccount 3total
XSL file below.... any ideas????
<?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" />
<xsl:key name="data-by-account" match="udt:Data" use="udt:Account" />
<xsl:variable name="prefix_param">udt_<xsl:value-of select="//udt:Context/udt:ModuleId" />_param</xsl:variable>
<xsl:template match="udt:Data" mode="list">
<tr class="Normal">
<td>
<xsl:value-of select="udt:Account" disable-output-escaping="yes" />
</td>
<td>
<div class="row" style="text-align:right">
<xsl:variable name="tAmount" select="udt:Account" />
<xsl:value-of select="sum(//udt:Data[udt:Account=$tAmount]/udt:Amount)" disable-output-escaping="yes" />
</div>
</td>
</tr>
</xsl:template>
<xsl:template match="/udt:UserDefinedTable">
<xsl:variable name="currentData" select="udt:Data[count(. | key('data-by-account', udt:Account)[1]) = 1]" />
<xsl:if test="$currentData">
<table width="100%">
<tr>
<th width="20%" align="left">Account</th>
<th width="20%" align="right">Amount</th>
</tr>
<xsl:apply-templates select="$currentData" mode="list">
<xsl:sort select="Account" data-type="number" order="ascending" />
</xsl:apply-templates>
</table>
</xsl:if>
</xsl:template>
</xsl:stylesheet>