|
Xsl test:
<? xml version = "1.0" encoding = "UTF-8"?>
<xsl: stylesheet version = "1.0" xmlns: xsl = "http://www.w3.org/1999/XSL/Transform">
<!-Global Variables->
<xsl: variable name = "Columns" select = "/ MonthBankRollPlanOfDepartReport / SchemaInfo / Columns" /> <!-Column format->
<xsl: variable name = "Rows" select = "/ MonthBankRollPlanOfDepartReport / SchemaInfo / Rows" /> <!-row format->
<xsl: variable name = "ColumnInfo" select = "/ MonthBankRollPlanOfDepartReport / Data / ColumnInfo" /> <!-Data column information->
<xsl: variable name = "DataInfo" select = "/ MonthBankRollPlanOfDepartReport / Data / DataInfo" /> <!-Data Information->
<xsl: variable name = "ShowMonthColumn" select = "/ MonthBankRollPlanOfDepartReport / Data / ColumnInfo / ColumnDetail [starts-with (@ColumnName, 'A')]" /> <!-Show the month's column->
<xsl: variable name = "UnitColumnName" select = "/ MonthBankRollPlanOfDepartReport / SchemaInfo / Columns / Titles / TitleDetail / ColumnDetail [@IsUnit = 'true'] / @ ColumnName" /> <!-Merge column name->
<xsl: variable name = "RowColorColumnName" select = "$ Rows / RowColors / @ ColumnName" /> <!-row color column name->
<!-Template->
<!-Get the month column heading->
<xsl: template name = "GetMonthTitle">
<xsl: param name = "TitleIndex" /> <!-Title Index->
<xsl: variable name = "ColumnName" select = "$ ShowMonthColumn [$ TitleIndex] / @ ColumnName" />
<xsl: value-of select = "substring ($ ColumnName, 2, 4)" /> <xsl: value-of select = "'year'" /> <xsl: value-of select = "substring ($ ColumnName, 6) "/> <xsl: value-of select =" '月' "/>
</ xsl: template>
<!-Get the title->
<xsl: template name = "GetTitle">
<tr align = "center">
<!-Specify the format title->
<xsl: for-each select = "$ Columns / Titles / TitleDetail">
<td width = "{./@width}px">
<xsl: choose>
<xsl: when test = "./@IsFixed = 'true'">
<xsl: attribute name = "style">
<xsl: value-of select = "'background-color: # BED8FD; border-right: 1px solid #cccccc; border-top: 1px solid #cccccc; position: relative; left: expression (this.parentElement.parentElement.parentElement .parentElement.parentElement.parentElement.parentElement.parentElement.scrollLeft) '"/>
</ xsl: attribute>
</ xsl: when>
<xsl: otherwise>
<xsl: attribute name = "style">
<xsl: value-of select = "'border-right: 1px solid #cccccc; border-top: 1px solid #cccccc;'" />
</ xsl: attribute>
</ xsl: otherwise>
</ xsl: choose>
The
<!-Title name->
<xsl: value-of select = "./@TitleName" />
</ td>
</ xsl: for-each>
<!-Month Title->
<xsl: for-each select = "$ ShowMonthColumn">
<td width = "{$ Columns / Titles / DefaultTitle / @ width} px" style = "border-right: 1px solid #cccccc; border-top: 1px solid #cccccc;">
<xsl: call-template name = "GetMonthTitle">
<xsl: with-param name = "TitleIndex" select = "position ()" />
</ xsl: call-template>
</ td>
</ xsl: for-each>
</ tr>
</ xsl: template>
<!-Get the column name of the navigation->
<xsl: template name = "GetRowLinksColumnName">
<xsl: param name = "DataDetail" /> <!-Details of the line->
<xsl: for-each select = "$ Rows / RowLinks / RowDetail">
<xsl: variable name = "RowDetail" select = "." />
<xsl: if test = "$ DataDetail / FieldDetail [@Name = $ RowDetail / @ ColumnName] / @ Value = $ RowDetail / @ ColumnValue">
<xsl: value-of select = "$ RowDetail / @ ColumnName" />
</ xsl: if>
</ xsl: for-each>
</ xsl: template>
<!-Get the displayed data->
<xsl: template name = "GetShowValue">
<xsl: param name = "ColumnName" />
<xsl: param name = "ShowValue" />
<xsl: param name = "Position" />
The
<xsl: variable name = "DataDetail" select = "$ DataInfo / DataDetail [$ Position]" />
The
<xsl: variable name = "RowLinksColumnName"> <!-Navigation column name->
<xsl: call-template name = "GetRowLinksColumnName">
<xsl: with-param name = "DataDetail" select = "$ DataDetail" />
</ xsl: call-template>
</ xsl: variable>
<xsl: variable name = "RowLinksValue" select = "$ DataDetail / FieldDetail [@Name = $ RowLinksColumnName] / @ Value" />
<!-Get the hyperlink type->
<xsl: variable name = "LinkType">
<xsl: choose>
<xsl: when test = "count ($ Rows / RowLinks / RowDetail [@ColumnValue = $ RowLinksValue])> 0 and not (contains ($ DataDetail / FieldDetail [@Name = 'SysExpenseItemName'] / @ Value, 'Subtotal' )) ">
<xsl: value-of select = "$ Rows / RowLinks / RowDetail [@ColumnValue = $ RowLinksValue] / @ LinkType" />
</ xsl: when>
<xsl: otherwise>
<xsl: value-of select = "-1" />
</ xsl: otherwise>
</ xsl: choose>
</ xsl: variable>
<xsl: choose>
<xsl: when test = "number ($ ShowValue)"> <!-number->
<xsl: choose>
<xsl: when test = "$ ColumnName = 'Total'">
<xsl: value-of select = "format-number ($ ShowValue, '#, ###. 00')" />
</ xsl: when>
<xsl: otherwise>
<xsl: choose>
<xsl: when test = "number ($ ShowValue)! = 0">
<xsl: choose>
<xsl: when test = "$ LinkType! = -1">
<a href = "#" onclick = "GetDataList ('{$ DataDetail / FieldDetail [@Name =' CompanyID '] / @ Value}', '{$ DataDetail / FieldDetail [@Name =' SysExpenseItemID '] / @ Value} ',' {$ ColumnName} ',' {$ DataDetail / FieldDetail [@Name = 'DepartIDs'] / @ Value}', '{$ LinkType}'); ">
<xsl: value-of select = "format-number ($ ShowValue, '#, ###. 00')" />
</a>
</ xsl: when>
<xsl: otherwise>
<xsl: value-of select = "format-number ($ ShowValue, '#, ###. 00')" />
</ xsl: otherwise>
</ xsl: choose>
</ xsl: when>
<xsl: otherwise>
<xsl: value-of select = "format-number ($ ShowValue, '#, ###. 00')" />
</ xsl: otherwise>
</ xsl: choose>
</ xsl: otherwise>
</ xsl: choose>
</ xsl: when>
<xsl: otherwise>
<xsl: choose>
<xsl: when test = "$ LinkType = 1 and $ ShowValue! = '0'"> <!-The cost of navigation->
<a href = "#" onclick = "GetSysExpenseItemList ('{$ DataDetail / FieldDetail [@Name =' CompanyID '] / @ Value}', '{$ DataDetail / FieldDetail [@Name =' SysExpenseItemID '] / @ Value} ',' {$ DataDetail / FieldDetail [@Name = 'DepartIDs'] / @ Value}'); ">
<xsl: value-of select = "$ ShowValue" />
</a>
</ xsl: when>
<xsl: otherwise>
<xsl: value-of select = "$ ShowValue" />
</ xsl: otherwise>
</ xsl: choose>
</ xsl: otherwise>
</ xsl: choose>
</ xsl: template> |
|