<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
	<xsl:output method="html" version="1.0" encoding="UTF-8" indent="yes"/>

	<xsl:variable name="localization"      select="document('localization.xml')/strings/group[@name='report']//string"/>	
	
	<xsl:template match="/">
		
		<xsl:for-each select="/ReportList//Report">
			<xsl:if test="./@status != 'PRT_IN_PROGRESS'">
				<xsl:apply-templates select=".">
					<xsl:with-param name="pos" select="position()"/>
				</xsl:apply-templates>
			</xsl:if>
		</xsl:for-each>
	</xsl:template>	

	<xsl:template match="Report">
		<xsl:param name="pos"/>
		<xsl:variable name="row_toggle_style">
			<xsl:choose>
				<xsl:when test="1 = ($pos mod 2)">data1b</xsl:when>
				<xsl:otherwise>data2b</xsl:otherwise>
			</xsl:choose>
		</xsl:variable>
		
		<tr><td><xsl:attribute name="class"><xsl:value-of select="$row_toggle_style"/></xsl:attribute>
				<input type="checkbox" name="chkItems" onclick="jsItems_Click(fmMain.chkSelectAll, fmMain.chkItems, true);">
				<xsl:attribute name="value"><xsl:value-of select="@report_id"/></xsl:attribute></input></td>

			<td><xsl:attribute name="class"><xsl:value-of select="$row_toggle_style"/></xsl:attribute>
				<xsl:value-of select="@begin_time"/></td>

			<td><xsl:attribute name="class"><xsl:value-of select="$row_toggle_style"/></xsl:attribute>
				<xsl:value-of select="@end_time"/></td>

			<td><xsl:attribute name="class"><xsl:value-of select="$row_toggle_style"/></xsl:attribute>
				<xsl:value-of select="@generate_time"/></td>

			<td align="right">
				<xsl:attribute name="class"><xsl:value-of select="$row_toggle_style"/></xsl:attribute>
				<xsl:value-of select="format-number(@size div 1024, '###,##0.##')"/>KB</td>

			<td><xsl:attribute name="class"><xsl:value-of select="$row_toggle_style"/></xsl:attribute>
				<a><xsl:attribute name="href">javascript:jsViewItem('<xsl:value-of select="@template_id"/>', '<xsl:value-of select="@report_id"/>');</xsl:attribute><xsl:value-of select="$localization[@name='PRT_DONE']"/></a></td></tr>
	</xsl:template>
	
</xsl:stylesheet>
