|
|
@@ -1,1316 +1,496 @@
|
|
|
-<?xml version="1.0" encoding="UTF-8"?>
|
|
|
-<xsl:stylesheet version="1.0"
|
|
|
- xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:inet="http://www.inetsoftware.de">
|
|
|
- <xsl:output method="xml" version="1.0" encoding="UTF-8"
|
|
|
- indent="yes"
|
|
|
- cdata-section-elements="parameterDescription defaultValueExpression queryString text textFieldExpression subreportParameterExpression connectionExpression subreportExpression" />
|
|
|
- <xsl:template match="inet:Report">
|
|
|
- <!-- position rate from crystal to jasper -->
|
|
|
- <xsl:variable name="positionRate">
|
|
|
- 15
|
|
|
- </xsl:variable>
|
|
|
- <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"
|
|
|
- xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
- xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd"><!-- uuid="" -->
|
|
|
- <!-- variables -->
|
|
|
- <xsl:variable name="pageWidth"
|
|
|
- select="round(ReportProperties/PageWidth/@value div $positionRate)" />
|
|
|
- <xsl:variable name="pageHeight"
|
|
|
- select="round(ReportProperties/PageHeight/@value div $positionRate)" />
|
|
|
- <xsl:variable name="leftMargin"
|
|
|
- select="round(ReportProperties/PageMarginLeft/@value div $positionRate)" />
|
|
|
- <xsl:variable name="rightMargin"
|
|
|
- select="round(ReportProperties/PageMarginRight/@value div $positionRate)" />
|
|
|
- <xsl:variable name="topMargin"
|
|
|
- select="round(ReportProperties/PageMarginTop/@value div $positionRate)" />
|
|
|
- <xsl:variable name="bottomMargin"
|
|
|
- select="round(ReportProperties/PageMarginBottom/@value div $positionRate)" />
|
|
|
-
|
|
|
- <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
|
|
|
- <xsl:attribute name="pageWidth"><xsl:value-of select="$pageWidth" /></xsl:attribute>
|
|
|
- <xsl:attribute name="pageHeight"><xsl:value-of select="$pageHeight" /></xsl:attribute>
|
|
|
- <xsl:attribute name="columnWidth"><xsl:value-of
|
|
|
- select="round($pageWidth - $leftMargin - $rightMargin)" /></xsl:attribute>
|
|
|
- <xsl:attribute name="leftMargin"><xsl:value-of select="$leftMargin" /></xsl:attribute>
|
|
|
- <xsl:attribute name="rightMargin"><xsl:value-of select="$rightMargin" /></xsl:attribute>
|
|
|
- <xsl:attribute name="topMargin"><xsl:value-of select="$topMargin" /></xsl:attribute>
|
|
|
- <xsl:attribute name="bottomMargin"><xsl:value-of select="$bottomMargin" /></xsl:attribute>
|
|
|
-
|
|
|
- <!-- parameters -->
|
|
|
- <parameter name="WHERE_CONDITION" class="java.lang.String">
|
|
|
- <parameterDescription>where子句</parameterDescription>
|
|
|
- <defaultValueExpression>"where rownum<=1"
|
|
|
- </defaultValueExpression>
|
|
|
- </parameter>
|
|
|
- <parameter name="REPORT_DIR" class="java.lang.String">
|
|
|
- <parameterDescription>报表的路径</parameterDescription>
|
|
|
- <defaultValueExpression>"/mnt/data/reports"</defaultValueExpression>
|
|
|
- </parameter>
|
|
|
- <!-- subreport parameters -->
|
|
|
- <xsl:for-each select="PromptFields/Field[@type='PromptVarField']">
|
|
|
- <xsl:variable name="name" select="substring-after(Name/@value,'Pm-')" />
|
|
|
- <xsl:if test="$name">
|
|
|
- <parameter>
|
|
|
- <xsl:variable name="type" select="@valueType" />
|
|
|
- <!-- name -->
|
|
|
- <xsl:attribute name="name"><xsl:value-of
|
|
|
- select="$name" /></xsl:attribute>
|
|
|
- <!-- class -->
|
|
|
- <xsl:attribute name="class">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='6'">java.math.BigDecimal</xsl:when>
|
|
|
- <xsl:when test="$type='9'">java.sql.Timestamp</xsl:when>
|
|
|
- <xsl:when test="$type='11'">java.lang.String</xsl:when>
|
|
|
- <xsl:when test="$type='15'">java.sql.Timestamp</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- <!-- default value -->
|
|
|
- <defaultValueExpression>
|
|
|
- <xsl:value-of select="concat('$P{',$name,'}')" />
|
|
|
- </defaultValueExpression>
|
|
|
- </parameter>
|
|
|
- </xsl:if>
|
|
|
- </xsl:for-each>
|
|
|
-
|
|
|
- <queryString>
|
|
|
- select * from dual;
|
|
|
- </queryString>
|
|
|
-
|
|
|
- <!-- fields -->
|
|
|
- <xsl:for-each select="Datasource/Tablesource/Column">
|
|
|
- <xsl:variable name="tableName"
|
|
|
- select="substring-after(../@databaseIdentifier,'.')" />
|
|
|
- <field>
|
|
|
- <xsl:attribute name="name"><xsl:value-of
|
|
|
- select="concat($tableName,'.',@name)" /></xsl:attribute>
|
|
|
- <xsl:attribute name="class">
|
|
|
- <xsl:variable name="type" select="@type" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='6'">java.math.BigDecimal</xsl:when>
|
|
|
- <xsl:when test="$type='9'">java.sql.Timestamp</xsl:when>
|
|
|
- <xsl:when test="$type='11'">java.lang.String</xsl:when>
|
|
|
- <xsl:when test="$type='15'">java.sql.Timestamp</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- </field>
|
|
|
- </xsl:for-each>
|
|
|
-
|
|
|
- <!-- title -->
|
|
|
- <xsl:if test="AreaPair[@type='ReportAreaPair']/Area[@type='ReportHeader']">
|
|
|
- <title>
|
|
|
- <band splitType="Stretch">
|
|
|
- <xsl:attribute name="height"><xsl:value-of
|
|
|
- select="round(AreaPair[@type='ReportAreaPair']/Area[@type='ReportHeader']/Section/@height div $positionRate)" /></xsl:attribute>
|
|
|
- <xsl:for-each
|
|
|
- select="AreaPair[@type='ReportAreaPair']/Area[@type='ReportHeader']/Section/Element">
|
|
|
- <xsl:variable name="type" select="@type" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='Box'"></xsl:when>
|
|
|
- <xsl:when test="$type='Line'"></xsl:when>
|
|
|
- <!-- staticText -->
|
|
|
- <xsl:when test="$type='Text'">
|
|
|
- <staticText>
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- border -->
|
|
|
- <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
- rightPadding="2">
|
|
|
- <pen lineWidth="0.2" />
|
|
|
- <topPen lineWidth="0.2" />
|
|
|
- <leftPen lineWidth="0.2" />
|
|
|
- <bottomPen lineWidth="0.2" />
|
|
|
- <rightPen lineWidth="0.2" />
|
|
|
- </box>
|
|
|
- <!-- align -->
|
|
|
- <textElement verticalAlignment="Middle">
|
|
|
- <xsl:variable name="textAlignment"
|
|
|
- select="CommonProperties/HorizontalAlign/@value" />
|
|
|
- <!-- horizontal align -->
|
|
|
- <xsl:if test="$textAlignment">
|
|
|
- <xsl:attribute name="textAlignment">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font -->
|
|
|
- <font fontName="Microsoft YaHei UI">
|
|
|
- <!-- font size -->
|
|
|
- <xsl:if test="FontProperties/FontSize">
|
|
|
- <xsl:attribute name="size"><xsl:value-of
|
|
|
- select="round(Element/Element/FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font style -->
|
|
|
- <xsl:variable name="fontStyle"
|
|
|
- select="Element/Element/FontProperties/FontStyle/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- <!-- font underline -->
|
|
|
- <xsl:if test="Element/Element/FontProperties/Underline/@value">
|
|
|
- <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font strikethrough -->
|
|
|
- <xsl:if test="Element/Element/FontProperties/Strikeout/@value">
|
|
|
- <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- </font>
|
|
|
- </textElement>
|
|
|
- <text>
|
|
|
- <xsl:value-of select="Element/Element/TextData" />
|
|
|
- </text>
|
|
|
- </staticText>
|
|
|
- </xsl:when>
|
|
|
- <!-- textField -->
|
|
|
- <xsl:when test="$type='FieldElement'">
|
|
|
- <textField isBlankWhenNull="true">
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- border -->
|
|
|
- <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
- rightPadding="2">
|
|
|
- <pen lineWidth="0.2" />
|
|
|
- <topPen lineWidth="0.2" />
|
|
|
- <leftPen lineWidth="0.2" />
|
|
|
- <bottomPen lineWidth="0.2" />
|
|
|
- <rightPen lineWidth="0.2" />
|
|
|
- </box>
|
|
|
- <!-- align -->
|
|
|
- <textElement verticalAlignment="Middle">
|
|
|
- <xsl:variable name="textAlignment"
|
|
|
- select="CommonProperties/HorizontalAlign/@value" />
|
|
|
- <!-- horizontal align -->
|
|
|
- <xsl:if test="$textAlignment">
|
|
|
- <xsl:attribute name="textAlignment">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font -->
|
|
|
- <font fontName="Microsoft YaHei UI">
|
|
|
- <!-- font size -->
|
|
|
- <xsl:if test="FontProperties/FontSize">
|
|
|
- <xsl:attribute name="size"><xsl:value-of
|
|
|
- select="round(FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font style -->
|
|
|
- <xsl:variable name="fontStyle"
|
|
|
- select="FontProperties/FontStyle/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- <!-- font underline -->
|
|
|
- <xsl:if test="FontProperties/Underline/@value">
|
|
|
- <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font strikethrough -->
|
|
|
- <xsl:if test="FontProperties/Strikeout/@value">
|
|
|
- <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- </font>
|
|
|
- </textElement>
|
|
|
- <!-- textFieldExpression -->
|
|
|
- <xsl:if test="Reference">
|
|
|
- <xsl:variable name="type" select="Reference/@type" />
|
|
|
- <xsl:variable name="value" select="Reference/@value" />
|
|
|
- <textFieldExpression>
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='DatabaseField'">
|
|
|
- <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$type='FormulaField'">
|
|
|
- <xsl:value-of select="concat('@FormulaField ',$value)" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$type='SpecialVarField'">
|
|
|
- <xsl:value-of select="concat('@SpecialVarField ',$value)" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
- <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </textFieldExpression>
|
|
|
- </xsl:if>
|
|
|
- </textField>
|
|
|
- </xsl:when>
|
|
|
- <!-- subreport -->
|
|
|
- <xsl:when test="$type='Subreport'">
|
|
|
- <subreport>
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- subreportParameter -->
|
|
|
- <xsl:for-each select="SubreportLinks/SubreportLink">
|
|
|
- <subreportParameter>
|
|
|
- <xsl:variable name="type" select="Reference/@type" />
|
|
|
- <xsl:variable name="value" select="Reference/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='DatabaseField'">
|
|
|
- <xsl:attribute name="name">
|
|
|
- <xsl:value-of select="$value" />
|
|
|
- </xsl:attribute>
|
|
|
- <subreportParameterExpression>
|
|
|
- <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
- </subreportParameterExpression>
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
- <xsl:attribute name="name">
|
|
|
- <xsl:value-of select="$value" />
|
|
|
- </xsl:attribute>
|
|
|
- <subreportParameterExpression>
|
|
|
- <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
- </subreportParameterExpression>
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </subreportParameter>
|
|
|
- </xsl:for-each>
|
|
|
- <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
|
|
|
- <!-- sub id <= replace with report name -->
|
|
|
- <id>
|
|
|
- <xsl:value-of select="SubreportProperties/Id/@value" />
|
|
|
- </id>
|
|
|
- <subreportExpression></subreportExpression>
|
|
|
- </subreport>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:for-each>
|
|
|
- </band>
|
|
|
- </title>
|
|
|
- </xsl:if>
|
|
|
-
|
|
|
- <!-- pageHeader -->
|
|
|
- <xsl:if test="AreaPair[@type='PageAreaPair']/Area[@type='PageHeader']">
|
|
|
- <pageHeader>
|
|
|
- <band splitType="Stretch">
|
|
|
- <xsl:attribute name="height"><xsl:value-of
|
|
|
- select="round(AreaPair[@type='PageAreaPair']/Area[@type='PageHeader']/Section/@height div $positionRate)" /></xsl:attribute>
|
|
|
- <xsl:for-each
|
|
|
- select="AreaPair[@type='PageAreaPair']/Area[@type='PageHeader']/Section/Element">
|
|
|
- <xsl:variable name="type" select="@type" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='Box'"></xsl:when>
|
|
|
- <xsl:when test="$type='Line'"></xsl:when>
|
|
|
- <!-- staticText -->
|
|
|
- <xsl:when test="$type='Text'">
|
|
|
- <staticText>
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- border -->
|
|
|
- <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
- rightPadding="2">
|
|
|
- <pen lineWidth="0.2" />
|
|
|
- <topPen lineWidth="0.2" />
|
|
|
- <leftPen lineWidth="0.2" />
|
|
|
- <bottomPen lineWidth="0.2" />
|
|
|
- <rightPen lineWidth="0.2" />
|
|
|
- </box>
|
|
|
- <!-- align -->
|
|
|
- <textElement verticalAlignment="Middle">
|
|
|
- <xsl:variable name="textAlignment"
|
|
|
- select="CommonProperties/HorizontalAlign/@value" />
|
|
|
- <!-- horizontal align -->
|
|
|
- <xsl:if test="$textAlignment">
|
|
|
- <xsl:attribute name="textAlignment">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font -->
|
|
|
- <font fontName="Microsoft YaHei UI">
|
|
|
- <!-- font size -->
|
|
|
- <xsl:if test="FontProperties/FontSize">
|
|
|
- <xsl:attribute name="size"><xsl:value-of
|
|
|
- select="round(Element/Element/FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font style -->
|
|
|
- <xsl:variable name="fontStyle"
|
|
|
- select="Element/Element/FontProperties/FontStyle/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- <!-- font underline -->
|
|
|
- <xsl:if test="Element/Element/FontProperties/Underline/@value">
|
|
|
- <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font strikethrough -->
|
|
|
- <xsl:if test="Element/Element/FontProperties/Strikeout/@value">
|
|
|
- <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- </font>
|
|
|
- </textElement>
|
|
|
- <text>
|
|
|
- <xsl:value-of select="Element/Element/TextData" />
|
|
|
- </text>
|
|
|
- </staticText>
|
|
|
- </xsl:when>
|
|
|
- <!-- textField -->
|
|
|
- <xsl:when test="$type='FieldElement'">
|
|
|
- <textField isBlankWhenNull="true">
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- border -->
|
|
|
- <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
- rightPadding="2">
|
|
|
- <pen lineWidth="0.2" />
|
|
|
- <topPen lineWidth="0.2" />
|
|
|
- <leftPen lineWidth="0.2" />
|
|
|
- <bottomPen lineWidth="0.2" />
|
|
|
- <rightPen lineWidth="0.2" />
|
|
|
- </box>
|
|
|
- <!-- align -->
|
|
|
- <textElement verticalAlignment="Middle">
|
|
|
- <xsl:variable name="textAlignment"
|
|
|
- select="CommonProperties/HorizontalAlign/@value" />
|
|
|
- <!-- horizontal align -->
|
|
|
- <xsl:if test="$textAlignment">
|
|
|
- <xsl:attribute name="textAlignment">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font -->
|
|
|
- <font fontName="Microsoft YaHei UI">
|
|
|
- <!-- font size -->
|
|
|
- <xsl:if test="FontProperties/FontSize">
|
|
|
- <xsl:attribute name="size"><xsl:value-of
|
|
|
- select="round(FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font style -->
|
|
|
- <xsl:variable name="fontStyle"
|
|
|
- select="FontProperties/FontStyle/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- <!-- font underline -->
|
|
|
- <xsl:if test="FontProperties/Underline/@value">
|
|
|
- <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font strikethrough -->
|
|
|
- <xsl:if test="FontProperties/Strikeout/@value">
|
|
|
- <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- </font>
|
|
|
- </textElement>
|
|
|
- <!-- textFieldExpression -->
|
|
|
- <xsl:if test="Reference">
|
|
|
- <xsl:variable name="type" select="Reference/@type" />
|
|
|
- <xsl:variable name="value" select="Reference/@value" />
|
|
|
- <textFieldExpression>
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='DatabaseField'">
|
|
|
- <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$type='FormulaField'">
|
|
|
- <xsl:value-of select="concat('@FormulaField ',$value)" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$type='SpecialVarField'">
|
|
|
- <xsl:value-of select="concat('@SpecialVarField ',$value)" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
- <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </textFieldExpression>
|
|
|
- </xsl:if>
|
|
|
- </textField>
|
|
|
- </xsl:when>
|
|
|
- <!-- subreport -->
|
|
|
- <xsl:when test="$type='Subreport'">
|
|
|
- <subreport>
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- subreportParameter -->
|
|
|
- <xsl:for-each select="SubreportLinks/SubreportLink">
|
|
|
- <subreportParameter>
|
|
|
- <xsl:variable name="type" select="Reference/@type" />
|
|
|
- <xsl:variable name="value" select="Reference/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='DatabaseField'">
|
|
|
- <xsl:attribute name="name">
|
|
|
- <xsl:value-of select="$value" />
|
|
|
- </xsl:attribute>
|
|
|
- <subreportParameterExpression>
|
|
|
- <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
- </subreportParameterExpression>
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
- <xsl:attribute name="name">
|
|
|
- <xsl:value-of select="$value" />
|
|
|
- </xsl:attribute>
|
|
|
- <subreportParameterExpression>
|
|
|
- <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
- </subreportParameterExpression>
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </subreportParameter>
|
|
|
- </xsl:for-each>
|
|
|
- <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
|
|
|
- <!-- sub id <= replace with report name -->
|
|
|
- <id>
|
|
|
- <xsl:value-of select="SubreportProperties/Id/@value" />
|
|
|
- </id>
|
|
|
- <subreportExpression></subreportExpression>
|
|
|
- </subreport>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:for-each>
|
|
|
- </band>
|
|
|
- </pageHeader>
|
|
|
- </xsl:if>
|
|
|
-
|
|
|
- <!-- detail -->
|
|
|
- <xsl:if test="AreaPair[@type='DetailArea']/Area[@type='Detail']">
|
|
|
- <detail>
|
|
|
- <band splitType="Prevent">
|
|
|
- <xsl:attribute name="height"><xsl:value-of
|
|
|
- select="round(AreaPair[@type='DetailArea']/Area[@type='Detail']/Section/@height div $positionRate)" /></xsl:attribute>
|
|
|
- <xsl:for-each
|
|
|
- select="AreaPair[@type='DetailArea']/Area[@type='Detail']/Section/Element">
|
|
|
- <xsl:variable name="type" select="@type" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='Box'"></xsl:when>
|
|
|
- <xsl:when test="$type='Line'"></xsl:when>
|
|
|
- <!-- staticText -->
|
|
|
- <xsl:when test="$type='Text'">
|
|
|
- <staticText>
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- border -->
|
|
|
- <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
- rightPadding="2">
|
|
|
- <pen lineWidth="0.2" />
|
|
|
- <topPen lineWidth="0.2" />
|
|
|
- <leftPen lineWidth="0.2" />
|
|
|
- <bottomPen lineWidth="0.2" />
|
|
|
- <rightPen lineWidth="0.2" />
|
|
|
- </box>
|
|
|
- <!-- align -->
|
|
|
- <textElement verticalAlignment="Middle">
|
|
|
- <xsl:variable name="textAlignment"
|
|
|
- select="CommonProperties/HorizontalAlign/@value" />
|
|
|
- <!-- horizontal align -->
|
|
|
- <xsl:if test="$textAlignment">
|
|
|
- <xsl:attribute name="textAlignment">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font -->
|
|
|
- <font fontName="Microsoft YaHei UI">
|
|
|
- <!-- font size -->
|
|
|
- <xsl:if test="FontProperties/FontSize">
|
|
|
- <xsl:attribute name="size"><xsl:value-of
|
|
|
- select="round(Element/Element/FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font style -->
|
|
|
- <xsl:variable name="fontStyle"
|
|
|
- select="Element/Element/FontProperties/FontStyle/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- <!-- font underline -->
|
|
|
- <xsl:if test="Element/Element/FontProperties/Underline/@value">
|
|
|
- <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font strikethrough -->
|
|
|
- <xsl:if test="Element/Element/FontProperties/Strikeout/@value">
|
|
|
- <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- </font>
|
|
|
- </textElement>
|
|
|
- <text>
|
|
|
- <xsl:value-of select="Element/Element/TextData" />
|
|
|
- </text>
|
|
|
- </staticText>
|
|
|
- </xsl:when>
|
|
|
- <!-- textField -->
|
|
|
- <xsl:when test="$type='FieldElement'">
|
|
|
- <textField isStretchWithOverflow="true"
|
|
|
- isBlankWhenNull="true">
|
|
|
- <reportElement stretchType="RelativeToTallestObject"
|
|
|
- mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- border -->
|
|
|
- <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
- rightPadding="2">
|
|
|
- <pen lineWidth="0.2" />
|
|
|
- <topPen lineWidth="0.2" />
|
|
|
- <leftPen lineWidth="0.2" />
|
|
|
- <bottomPen lineWidth="0.2" />
|
|
|
- <rightPen lineWidth="0.2" />
|
|
|
- </box>
|
|
|
- <!-- align -->
|
|
|
- <textElement verticalAlignment="Middle">
|
|
|
- <xsl:variable name="textAlignment"
|
|
|
- select="CommonProperties/HorizontalAlign/@value" />
|
|
|
- <!-- horizontal align -->
|
|
|
- <xsl:if test="$textAlignment">
|
|
|
- <xsl:attribute name="textAlignment">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font -->
|
|
|
- <font fontName="Microsoft YaHei UI">
|
|
|
- <!-- font size -->
|
|
|
- <xsl:if test="FontProperties/FontSize">
|
|
|
- <xsl:attribute name="size"><xsl:value-of
|
|
|
- select="round(FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font style -->
|
|
|
- <xsl:variable name="fontStyle"
|
|
|
- select="FontProperties/FontStyle/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- <!-- font underline -->
|
|
|
- <xsl:if test="FontProperties/Underline/@value">
|
|
|
- <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font strikethrough -->
|
|
|
- <xsl:if test="FontProperties/Strikeout/@value">
|
|
|
- <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- </font>
|
|
|
- </textElement>
|
|
|
- <!-- textFieldExpression -->
|
|
|
- <xsl:if test="Reference">
|
|
|
- <xsl:variable name="type" select="Reference/@type" />
|
|
|
- <xsl:variable name="value" select="Reference/@value" />
|
|
|
- <textFieldExpression>
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='DatabaseField'">
|
|
|
- <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$type='FormulaField'">
|
|
|
- <xsl:value-of select="concat('@FormulaField ',$value)" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$type='SpecialVarField'">
|
|
|
- <xsl:value-of select="concat('@SpecialVarField ',$value)" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
- <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </textFieldExpression>
|
|
|
- </xsl:if>
|
|
|
- </textField>
|
|
|
- </xsl:when>
|
|
|
- <!-- subreport -->
|
|
|
- <xsl:when test="$type='Subreport'">
|
|
|
- <subreport>
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- subreportParameter -->
|
|
|
- <xsl:for-each select="SubreportLinks/SubreportLink">
|
|
|
- <subreportParameter>
|
|
|
- <xsl:variable name="type" select="Reference/@type" />
|
|
|
- <xsl:variable name="value" select="Reference/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='DatabaseField'">
|
|
|
- <xsl:attribute name="name">
|
|
|
- <xsl:value-of select="$value" />
|
|
|
- </xsl:attribute>
|
|
|
- <subreportParameterExpression>
|
|
|
- <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
- </subreportParameterExpression>
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
- <xsl:attribute name="name">
|
|
|
- <xsl:value-of select="$value" />
|
|
|
- </xsl:attribute>
|
|
|
- <subreportParameterExpression>
|
|
|
- <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
- </subreportParameterExpression>
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </subreportParameter>
|
|
|
- </xsl:for-each>
|
|
|
- <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
|
|
|
- <!-- sub id <= replace with report name -->
|
|
|
- <id>
|
|
|
- <xsl:value-of select="SubreportProperties/Id/@value" />
|
|
|
- </id>
|
|
|
- <subreportExpression></subreportExpression>
|
|
|
- </subreport>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:for-each>
|
|
|
- </band>
|
|
|
- </detail>
|
|
|
- </xsl:if>
|
|
|
-
|
|
|
- <!-- pageFooter -->
|
|
|
- <xsl:if test="AreaPair[@type='PageAreaPair']/Area[@type='PageFooter']">
|
|
|
- <pageFooter>
|
|
|
- <band splitType="Prevent">
|
|
|
- <xsl:attribute name="height"><xsl:value-of
|
|
|
- select="round(AreaPair[@type='PageAreaPair']/Area[@type='PageFooter']/Section/@height div $positionRate)" /></xsl:attribute>
|
|
|
- <xsl:for-each
|
|
|
- select="AreaPair[@type='PageAreaPair']/Area[@type='PageFooter']/Section/Element">
|
|
|
- <xsl:variable name="type" select="@type" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='Box'"></xsl:when>
|
|
|
- <xsl:when test="$type='Line'"></xsl:when>
|
|
|
- <!-- staticText -->
|
|
|
- <xsl:when test="$type='Text'">
|
|
|
- <staticText>
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- border -->
|
|
|
- <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
- rightPadding="2">
|
|
|
- <pen lineWidth="0.2" />
|
|
|
- <topPen lineWidth="0.2" />
|
|
|
- <leftPen lineWidth="0.2" />
|
|
|
- <bottomPen lineWidth="0.2" />
|
|
|
- <rightPen lineWidth="0.2" />
|
|
|
- </box>
|
|
|
- <!-- align -->
|
|
|
- <textElement verticalAlignment="Middle">
|
|
|
- <xsl:variable name="textAlignment"
|
|
|
- select="CommonProperties/HorizontalAlign/@value" />
|
|
|
- <!-- horizontal align -->
|
|
|
- <xsl:if test="$textAlignment">
|
|
|
- <xsl:attribute name="textAlignment">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font -->
|
|
|
- <font fontName="Microsoft YaHei UI">
|
|
|
- <!-- font size -->
|
|
|
- <xsl:if test="FontProperties/FontSize">
|
|
|
- <xsl:attribute name="size"><xsl:value-of
|
|
|
- select="round(Element/Element/FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font style -->
|
|
|
- <xsl:variable name="fontStyle"
|
|
|
- select="Element/Element/FontProperties/FontStyle/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- <!-- font underline -->
|
|
|
- <xsl:if test="Element/Element/FontProperties/Underline/@value">
|
|
|
- <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font strikethrough -->
|
|
|
- <xsl:if test="Element/Element/FontProperties/Strikeout/@value">
|
|
|
- <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- </font>
|
|
|
- </textElement>
|
|
|
- <text>
|
|
|
- <xsl:value-of select="Element/Element/TextData" />
|
|
|
- </text>
|
|
|
- </staticText>
|
|
|
- </xsl:when>
|
|
|
- <!-- textField -->
|
|
|
- <xsl:when test="$type='FieldElement'">
|
|
|
- <textField isBlankWhenNull="true">
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- border -->
|
|
|
- <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
- rightPadding="2">
|
|
|
- <pen lineWidth="0.2" />
|
|
|
- <topPen lineWidth="0.2" />
|
|
|
- <leftPen lineWidth="0.2" />
|
|
|
- <bottomPen lineWidth="0.2" />
|
|
|
- <rightPen lineWidth="0.2" />
|
|
|
- </box>
|
|
|
- <!-- align -->
|
|
|
- <textElement verticalAlignment="Middle">
|
|
|
- <xsl:variable name="textAlignment"
|
|
|
- select="CommonProperties/HorizontalAlign/@value" />
|
|
|
- <!-- horizontal align -->
|
|
|
- <xsl:if test="$textAlignment">
|
|
|
- <xsl:attribute name="textAlignment">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font -->
|
|
|
- <font fontName="Microsoft YaHei UI">
|
|
|
- <!-- font size -->
|
|
|
- <xsl:if test="FontProperties/FontSize">
|
|
|
- <xsl:attribute name="size"><xsl:value-of
|
|
|
- select="round(FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font style -->
|
|
|
- <xsl:variable name="fontStyle"
|
|
|
- select="FontProperties/FontStyle/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- <!-- font underline -->
|
|
|
- <xsl:if test="FontProperties/Underline/@value">
|
|
|
- <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font strikethrough -->
|
|
|
- <xsl:if test="FontProperties/Strikeout/@value">
|
|
|
- <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- </font>
|
|
|
- </textElement>
|
|
|
- <!-- textFieldExpression -->
|
|
|
- <xsl:if test="Reference">
|
|
|
- <xsl:variable name="type" select="Reference/@type" />
|
|
|
- <xsl:variable name="value" select="Reference/@value" />
|
|
|
- <textFieldExpression>
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='DatabaseField'">
|
|
|
- <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$type='FormulaField'">
|
|
|
- <xsl:value-of select="concat('@FormulaField ',$value)" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$type='SpecialVarField'">
|
|
|
- <xsl:value-of select="concat('@SpecialVarField ',$value)" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
- <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </textFieldExpression>
|
|
|
- </xsl:if>
|
|
|
- </textField>
|
|
|
- </xsl:when>
|
|
|
- <!-- subreport -->
|
|
|
- <xsl:when test="$type='Subreport'">
|
|
|
- <subreport>
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- subreportParameter -->
|
|
|
- <xsl:for-each select="SubreportLinks/SubreportLink">
|
|
|
- <subreportParameter>
|
|
|
- <xsl:variable name="type" select="Reference/@type" />
|
|
|
- <xsl:variable name="value" select="Reference/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='DatabaseField'">
|
|
|
- <xsl:attribute name="name">
|
|
|
- <xsl:value-of select="$value" />
|
|
|
- </xsl:attribute>
|
|
|
- <subreportParameterExpression>
|
|
|
- <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
- </subreportParameterExpression>
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
- <xsl:attribute name="name">
|
|
|
- <xsl:value-of select="$value" />
|
|
|
- </xsl:attribute>
|
|
|
- <subreportParameterExpression>
|
|
|
- <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
- </subreportParameterExpression>
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </subreportParameter>
|
|
|
- </xsl:for-each>
|
|
|
- <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
|
|
|
- <!-- sub id <= replace with report name -->
|
|
|
- <id>
|
|
|
- <xsl:value-of select="SubreportProperties/Id/@value" />
|
|
|
- </id>
|
|
|
- <subreportExpression></subreportExpression>
|
|
|
- </subreport>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:for-each>
|
|
|
- </band>
|
|
|
- </pageFooter>
|
|
|
- </xsl:if>
|
|
|
-
|
|
|
- <!-- lastPageFooter -->
|
|
|
- <xsl:if test="AreaPair[@type='ReportAreaPair']/Area[@type='ReportFooter']">
|
|
|
- <lastPageFooter>
|
|
|
- <band splitType="Prevent">
|
|
|
- <xsl:attribute name="height"><xsl:value-of
|
|
|
- select="round(AreaPair[@type='ReportAreaPair']/Area[@type='ReportFooter']/Section/@height div $positionRate)" /></xsl:attribute>
|
|
|
- <xsl:for-each
|
|
|
- select="AreaPair[@type='ReportAreaPair']/Area[@type='ReportFooter']/Section/Element">
|
|
|
- <xsl:variable name="type" select="@type" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='Box'"></xsl:when>
|
|
|
- <xsl:when test="$type='Line'"></xsl:when>
|
|
|
- <!-- staticText -->
|
|
|
- <xsl:when test="$type='Text'">
|
|
|
- <staticText>
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- border -->
|
|
|
- <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
- rightPadding="2">
|
|
|
- <pen lineWidth="0.2" />
|
|
|
- <topPen lineWidth="0.2" />
|
|
|
- <leftPen lineWidth="0.2" />
|
|
|
- <bottomPen lineWidth="0.2" />
|
|
|
- <rightPen lineWidth="0.2" />
|
|
|
- </box>
|
|
|
- <!-- align -->
|
|
|
- <textElement verticalAlignment="Middle">
|
|
|
- <xsl:variable name="textAlignment"
|
|
|
- select="CommonProperties/HorizontalAlign/@value" />
|
|
|
- <!-- horizontal align -->
|
|
|
- <xsl:if test="$textAlignment">
|
|
|
- <xsl:attribute name="textAlignment">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font -->
|
|
|
- <font fontName="Microsoft YaHei UI">
|
|
|
- <!-- font size -->
|
|
|
- <xsl:if test="FontProperties/FontSize">
|
|
|
- <xsl:attribute name="size"><xsl:value-of
|
|
|
- select="round(Element/Element/FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font style -->
|
|
|
- <xsl:variable name="fontStyle"
|
|
|
- select="Element/Element/FontProperties/FontStyle/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- <!-- font underline -->
|
|
|
- <xsl:if test="Element/Element/FontProperties/Underline/@value">
|
|
|
- <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font strikethrough -->
|
|
|
- <xsl:if test="Element/Element/FontProperties/Strikeout/@value">
|
|
|
- <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- </font>
|
|
|
- </textElement>
|
|
|
- <text>
|
|
|
- <xsl:value-of select="Element/Element/TextData" />
|
|
|
- </text>
|
|
|
- </staticText>
|
|
|
- </xsl:when>
|
|
|
- <!-- textField -->
|
|
|
- <xsl:when test="$type='FieldElement'">
|
|
|
- <textField isBlankWhenNull="true">
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- border -->
|
|
|
- <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
- rightPadding="2">
|
|
|
- <pen lineWidth="0.2" />
|
|
|
- <topPen lineWidth="0.2" />
|
|
|
- <leftPen lineWidth="0.2" />
|
|
|
- <bottomPen lineWidth="0.2" />
|
|
|
- <rightPen lineWidth="0.2" />
|
|
|
- </box>
|
|
|
- <!-- align -->
|
|
|
- <textElement verticalAlignment="Middle">
|
|
|
- <xsl:variable name="textAlignment"
|
|
|
- select="CommonProperties/HorizontalAlign/@value" />
|
|
|
- <!-- horizontal align -->
|
|
|
- <xsl:if test="$textAlignment">
|
|
|
- <xsl:attribute name="textAlignment">
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
- <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font -->
|
|
|
- <font fontName="Microsoft YaHei UI">
|
|
|
- <!-- font size -->
|
|
|
- <xsl:if test="FontProperties/FontSize">
|
|
|
- <xsl:attribute name="size"><xsl:value-of
|
|
|
- select="round(FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font style -->
|
|
|
- <xsl:variable name="fontStyle"
|
|
|
- select="FontProperties/FontStyle/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
- <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
- <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- <!-- font underline -->
|
|
|
- <xsl:if test="FontProperties/Underline/@value">
|
|
|
- <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- <!-- font strikethrough -->
|
|
|
- <xsl:if test="FontProperties/Strikeout/@value">
|
|
|
- <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
- </xsl:if>
|
|
|
- </font>
|
|
|
- </textElement>
|
|
|
- <!-- textFieldExpression -->
|
|
|
- <xsl:if test="Reference">
|
|
|
- <xsl:variable name="type" select="Reference/@type" />
|
|
|
- <xsl:variable name="value" select="Reference/@value" />
|
|
|
- <textFieldExpression>
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='DatabaseField'">
|
|
|
- <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$type='FormulaField'">
|
|
|
- <xsl:value-of select="concat('@FormulaField ',$value)" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:when test="$type='SpecialVarField'">
|
|
|
- <xsl:value-of select="concat('@SpecialVarField ',$value)" />
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
- <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </textFieldExpression>
|
|
|
- </xsl:if>
|
|
|
- </textField>
|
|
|
- </xsl:when>
|
|
|
- <!-- subreport -->
|
|
|
- <xsl:when test="$type='Subreport'">
|
|
|
- <subreport>
|
|
|
- <reportElement mode="Opaque">
|
|
|
- <!-- position -->
|
|
|
- <xsl:attribute name="x">
|
|
|
- <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="y">
|
|
|
- <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="width">
|
|
|
- <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
- </xsl:attribute>
|
|
|
- <xsl:attribute name="height">
|
|
|
- <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
- </xsl:attribute>
|
|
|
- </reportElement>
|
|
|
- <!-- subreportParameter -->
|
|
|
- <xsl:for-each select="SubreportLinks/SubreportLink">
|
|
|
- <subreportParameter>
|
|
|
- <xsl:variable name="type" select="Reference/@type" />
|
|
|
- <xsl:variable name="value" select="Reference/@value" />
|
|
|
- <xsl:choose>
|
|
|
- <xsl:when test="$type='DatabaseField'">
|
|
|
- <xsl:attribute name="name">
|
|
|
- <xsl:value-of select="$value" />
|
|
|
- </xsl:attribute>
|
|
|
- <subreportParameterExpression>
|
|
|
- <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
- </subreportParameterExpression>
|
|
|
- </xsl:when>
|
|
|
- <xsl:otherwise>
|
|
|
- <xsl:attribute name="name">
|
|
|
- <xsl:value-of select="$value" />
|
|
|
- </xsl:attribute>
|
|
|
- <subreportParameterExpression>
|
|
|
- <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
- </subreportParameterExpression>
|
|
|
- </xsl:otherwise>
|
|
|
- </xsl:choose>
|
|
|
- </subreportParameter>
|
|
|
- </xsl:for-each>
|
|
|
- <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
|
|
|
- <!-- sub id <= replace with report name -->
|
|
|
- <id>
|
|
|
- <xsl:value-of select="SubreportProperties/Id/@value" />
|
|
|
- </id>
|
|
|
- <subreportExpression></subreportExpression>
|
|
|
- </subreport>
|
|
|
- </xsl:when>
|
|
|
- </xsl:choose>
|
|
|
- </xsl:for-each>
|
|
|
- </band>
|
|
|
- </lastPageFooter>
|
|
|
- </xsl:if>
|
|
|
- </jasperReport>
|
|
|
- </xsl:template>
|
|
|
+<?xml version="1.0" encoding="UTF-8"?>
|
|
|
+
|
|
|
+<xsl:stylesheet version="1.0"
|
|
|
+ xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:inet="http://www.inetsoftware.de">
|
|
|
+
|
|
|
+ <xsl:output method="xml" version="1.0" encoding="UTF-8"
|
|
|
+ indent="yes"
|
|
|
+ cdata-section-elements="parameterDescription defaultValueExpression queryString text textFieldExpression subreportParameterExpression connectionExpression subreportExpression" />
|
|
|
+ <!-- position rate from crystal to jasper -->
|
|
|
+
|
|
|
+ <xsl:variable name="positionRate">
|
|
|
+ 15
|
|
|
+ </xsl:variable>
|
|
|
+
|
|
|
+ <xsl:template match="inet:Report">
|
|
|
+ <jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports"
|
|
|
+ xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
|
|
|
+ xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd">
|
|
|
+ <!-- uuid="" -->
|
|
|
+ <!-- variables -->
|
|
|
+ <xsl:variable name="pageWidth"
|
|
|
+ select="round(ReportProperties/PageWidth/@value div $positionRate)" />
|
|
|
+ <xsl:variable name="pageHeight"
|
|
|
+ select="round(ReportProperties/PageHeight/@value div $positionRate)" />
|
|
|
+ <xsl:variable name="leftMargin"
|
|
|
+ select="round(ReportProperties/PageMarginLeft/@value div $positionRate)" />
|
|
|
+ <xsl:variable name="rightMargin"
|
|
|
+ select="round(ReportProperties/PageMarginRight/@value div $positionRate)" />
|
|
|
+ <xsl:variable name="topMargin"
|
|
|
+ select="round(ReportProperties/PageMarginTop/@value div $positionRate)" />
|
|
|
+ <xsl:variable name="bottomMargin"
|
|
|
+ select="round(ReportProperties/PageMarginBottom/@value div $positionRate)" />
|
|
|
+ <xsl:attribute name="name"><xsl:value-of select="@id" /></xsl:attribute>
|
|
|
+ <xsl:attribute name="pageWidth"><xsl:value-of select="$pageWidth" /></xsl:attribute>
|
|
|
+ <xsl:attribute name="pageHeight"><xsl:value-of select="$pageHeight" /></xsl:attribute>
|
|
|
+ <xsl:attribute name="columnWidth"><xsl:value-of
|
|
|
+ select="round($pageWidth - $leftMargin - $rightMargin)" /></xsl:attribute>
|
|
|
+ <xsl:attribute name="leftMargin"><xsl:value-of select="$leftMargin" /></xsl:attribute>
|
|
|
+ <xsl:attribute name="rightMargin"><xsl:value-of select="$rightMargin" /></xsl:attribute>
|
|
|
+ <xsl:attribute name="topMargin"><xsl:value-of select="$topMargin" /></xsl:attribute>
|
|
|
+ <xsl:attribute name="bottomMargin"><xsl:value-of select="$bottomMargin" /></xsl:attribute>
|
|
|
+ <!-- parameters -->
|
|
|
+ <parameter name="WHERE_CONDITION" class="java.lang.String">
|
|
|
+ <parameterDescription>where子句</parameterDescription>
|
|
|
+ <defaultValueExpression>"where rownum<=1"
|
|
|
+ </defaultValueExpression>
|
|
|
+ </parameter>
|
|
|
+ <parameter name="REPORT_DIR" class="java.lang.String">
|
|
|
+ <parameterDescription>报表的路径</parameterDescription>
|
|
|
+ <defaultValueExpression>"/mnt/data/reports"</defaultValueExpression>
|
|
|
+ </parameter>
|
|
|
+ <!-- subreport parameters -->
|
|
|
+ <xsl:for-each select="PromptFields/Field[@type='PromptVarField']">
|
|
|
+ <xsl:variable name="name" select="substring-after(Name/@value,'Pm-')" />
|
|
|
+ <xsl:if test="$name">
|
|
|
+ <parameter>
|
|
|
+ <xsl:variable name="type" select="@valueType" />
|
|
|
+ <!-- name -->
|
|
|
+ <xsl:attribute name="name"><xsl:value-of
|
|
|
+ select="$name" /></xsl:attribute>
|
|
|
+ <!-- class -->
|
|
|
+ <xsl:attribute name="class">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$type='6'">java.math.BigDecimal</xsl:when>
|
|
|
+ <xsl:when test="$type='9'">java.sql.Timestamp</xsl:when>
|
|
|
+ <xsl:when test="$type='11'">java.lang.String</xsl:when>
|
|
|
+ <xsl:when test="$type='15'">java.sql.Timestamp</xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:attribute>
|
|
|
+ <!-- default value -->
|
|
|
+ <defaultValueExpression>
|
|
|
+ <xsl:value-of select="concat('$P{',$name,'}')" />
|
|
|
+ </defaultValueExpression>
|
|
|
+ </parameter>
|
|
|
+ </xsl:if>
|
|
|
+ </xsl:for-each>
|
|
|
+
|
|
|
+ <queryString>
|
|
|
+ select * from dual;
|
|
|
+ </queryString>
|
|
|
+
|
|
|
+ <!-- fields -->
|
|
|
+ <xsl:for-each select="Datasource/Tablesource/Column">
|
|
|
+ <xsl:variable name="tableName"
|
|
|
+ select="substring-after(../@databaseIdentifier,'.')" />
|
|
|
+ <field>
|
|
|
+ <xsl:attribute name="name"><xsl:value-of
|
|
|
+ select="concat($tableName,'.',@name)" /></xsl:attribute>
|
|
|
+ <xsl:attribute name="class">
|
|
|
+ <xsl:variable name="type" select="@type" />
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$type='6'">java.math.BigDecimal</xsl:when>
|
|
|
+ <xsl:when test="$type='9'">java.sql.Timestamp</xsl:when>
|
|
|
+ <xsl:when test="$type='11'">java.lang.String</xsl:when>
|
|
|
+ <xsl:when test="$type='15'">java.sql.Timestamp</xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:attribute>
|
|
|
+ </field>
|
|
|
+ </xsl:for-each>
|
|
|
+ <!-- title -->
|
|
|
+ <xsl:if test="AreaPair[@type='ReportAreaPair']/Area[@type='ReportHeader']">
|
|
|
+ <title>
|
|
|
+ <band splitType="Stretch">
|
|
|
+ <xsl:attribute name="height"><xsl:value-of
|
|
|
+ select="round(AreaPair[@type='ReportAreaPair']/Area[@type='ReportHeader']/Section/@height div $positionRate)" /></xsl:attribute>
|
|
|
+ <xsl:for-each
|
|
|
+ select="AreaPair[@type='ReportAreaPair']/Area[@type='ReportHeader']/Section">
|
|
|
+ <xsl:apply-templates select="Element" />
|
|
|
+ </xsl:for-each>
|
|
|
+ </band>
|
|
|
+ </title>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- pageHeader -->
|
|
|
+ <xsl:if test="AreaPair[@type='PageAreaPair']/Area[@type='PageHeader']">
|
|
|
+ <pageHeader>
|
|
|
+ <band splitType="Stretch">
|
|
|
+ <xsl:attribute name="height"><xsl:value-of
|
|
|
+ select="round(AreaPair[@type='PageAreaPair']/Area[@type='PageHeader']/Section/@height div $positionRate)" /></xsl:attribute>
|
|
|
+ <xsl:for-each
|
|
|
+ select="AreaPair[@type='PageAreaPair']/Area[@type='PageHeader']/Section">
|
|
|
+ <xsl:apply-templates select="Element" />
|
|
|
+ </xsl:for-each>
|
|
|
+ </band>
|
|
|
+ </pageHeader>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- detail -->
|
|
|
+ <xsl:if test="AreaPair[@type='DetailArea']/Area[@type='Detail']">
|
|
|
+ <detail>
|
|
|
+ <band splitType="Prevent">
|
|
|
+ <xsl:attribute name="height"><xsl:value-of
|
|
|
+ select="round(AreaPair[@type='DetailArea']/Area[@type='Detail']/Section/@height div $positionRate)" /></xsl:attribute>
|
|
|
+ <xsl:for-each
|
|
|
+ select="AreaPair[@type='DetailArea']/Area[@type='Detail']/Section">
|
|
|
+ <xsl:apply-templates select="Element" />
|
|
|
+ </xsl:for-each>
|
|
|
+ </band>
|
|
|
+ </detail>
|
|
|
+ </xsl:if>
|
|
|
+
|
|
|
+ <!-- pageFooter -->
|
|
|
+ <xsl:if test="AreaPair[@type='PageAreaPair']/Area[@type='PageFooter']">
|
|
|
+ <pageFooter>
|
|
|
+ <band splitType="Prevent">
|
|
|
+ <xsl:attribute name="height"><xsl:value-of
|
|
|
+ select="round(AreaPair[@type='PageAreaPair']/Area[@type='PageFooter']/Section/@height div $positionRate)" /></xsl:attribute>
|
|
|
+ <xsl:for-each
|
|
|
+ select="AreaPair[@type='PageAreaPair']/Area[@type='PageFooter']/Section">
|
|
|
+ <xsl:apply-templates select="Element" />
|
|
|
+ </xsl:for-each>
|
|
|
+ </band>
|
|
|
+ </pageFooter>
|
|
|
+ </xsl:if>
|
|
|
+
|
|
|
+ <!-- lastPageFooter -->
|
|
|
+ <xsl:if test="AreaPair[@type='ReportAreaPair']/Area[@type='ReportFooter']">
|
|
|
+ <lastPageFooter>
|
|
|
+ <band splitType="Prevent">
|
|
|
+ <xsl:attribute name="height"><xsl:value-of
|
|
|
+ select="round(AreaPair[@type='ReportAreaPair']/Area[@type='ReportFooter']/Section/@height div $positionRate)" /></xsl:attribute>
|
|
|
+ <xsl:for-each
|
|
|
+ select="AreaPair[@type='ReportAreaPair']/Area[@type='ReportFooter']/Section">
|
|
|
+ <xsl:apply-templates select="Element" />
|
|
|
+ </xsl:for-each>
|
|
|
+ </band>
|
|
|
+ </lastPageFooter>
|
|
|
+ </xsl:if>
|
|
|
+ </jasperReport>
|
|
|
+ </xsl:template>
|
|
|
+
|
|
|
+ <xsl:template match="Element">
|
|
|
+ <xsl:variable name="type" select="@type" />
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$type='Box'">
|
|
|
+ <!-- <rectangle>
|
|
|
+ <reportElement mode="Opaque">
|
|
|
+ <xsl:variable name="x" select="@x_position" />
|
|
|
+ <xsl:variable name="y" select="@y_position" />
|
|
|
+ <xsl:variable name="x2" select="@x2_position" />
|
|
|
+ <xsl:variable name="y2" select="@y2_position" />
|
|
|
+ position
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$x2 > $x">
|
|
|
+ <xsl:attribute name="x">
|
|
|
+ <xsl:value-of select="round($x div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="width">
|
|
|
+ <xsl:value-of select="round(($x2 - $x) div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:attribute name="x">
|
|
|
+ <xsl:value-of select="round($x2 div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="width">
|
|
|
+ <xsl:value-of select="round(($x - $x2) div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$y2 > $y">
|
|
|
+ <xsl:attribute name="y">
|
|
|
+ <xsl:value-of select="round($y div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="height">
|
|
|
+ <xsl:value-of select="round(($y2 - $y) div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:attribute name="y">
|
|
|
+ <xsl:value-of select="round($y2 div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="height">
|
|
|
+ <xsl:value-of select="round(($y - $y2) div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </reportElement>
|
|
|
+ </rectangle> -->
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$type='Line'">
|
|
|
+ <!-- <line>
|
|
|
+ <reportElement mode="Opaque">
|
|
|
+ <xsl:variable name="x" select="@x_position" />
|
|
|
+ <xsl:variable name="y" select="@y_position" />
|
|
|
+ <xsl:variable name="x2" select="@x2_position" />
|
|
|
+ <xsl:variable name="y2" select="@y2_position" />
|
|
|
+ position
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$x2 > $x">
|
|
|
+ <xsl:attribute name="x">
|
|
|
+ <xsl:value-of select="round($x div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="width">
|
|
|
+ <xsl:value-of select="round(($x2 - $x) div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:attribute name="x">
|
|
|
+ <xsl:value-of select="round($x2 div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="width">
|
|
|
+ <xsl:value-of select="round(($x - $x2) div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$y2 > $y">
|
|
|
+ <xsl:attribute name="y">
|
|
|
+ <xsl:value-of select="round($y div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="height">
|
|
|
+ <xsl:value-of select="round(($y2 - $y) div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:attribute name="y">
|
|
|
+ <xsl:value-of select="round($y2 div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="height">
|
|
|
+ <xsl:value-of select="round(($y - $y2) div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </reportElement>
|
|
|
+ </line> -->
|
|
|
+ </xsl:when>
|
|
|
+ <!-- staticText -->
|
|
|
+ <xsl:when test="$type='Text'">
|
|
|
+ <staticText>
|
|
|
+ <reportElement mode="Opaque">
|
|
|
+ <!-- position -->
|
|
|
+ <xsl:attribute name="x">
|
|
|
+ <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="y">
|
|
|
+ <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="width">
|
|
|
+ <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="height">
|
|
|
+ <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </reportElement>
|
|
|
+ <!-- border -->
|
|
|
+ <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
+ rightPadding="2">
|
|
|
+ <pen lineWidth="0.2" />
|
|
|
+ <topPen lineWidth="0.2" />
|
|
|
+ <leftPen lineWidth="0.2" />
|
|
|
+ <bottomPen lineWidth="0.2" />
|
|
|
+ <rightPen lineWidth="0.2" />
|
|
|
+ </box>
|
|
|
+ <!-- align -->
|
|
|
+ <textElement verticalAlignment="Middle">
|
|
|
+ <xsl:variable name="textAlignment"
|
|
|
+ select="CommonProperties/HorizontalAlign/@value" />
|
|
|
+ <!-- horizontal align -->
|
|
|
+ <xsl:if test="$textAlignment">
|
|
|
+ <xsl:attribute name="textAlignment">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
+ <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
+ <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- font -->
|
|
|
+ <font fontName="Microsoft YaHei UI">
|
|
|
+ <!-- font size -->
|
|
|
+ <xsl:if test="FontProperties/FontSize">
|
|
|
+ <xsl:attribute name="size"><xsl:value-of
|
|
|
+ select="round(Element/Element/FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- font style -->
|
|
|
+ <xsl:variable name="fontStyle"
|
|
|
+ select="Element/Element/FontProperties/FontStyle/@value" />
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
+ <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
+ <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
+ <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
+ <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
+ </xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ <!-- font underline -->
|
|
|
+ <xsl:if test="Element/Element/FontProperties/Underline/@value">
|
|
|
+ <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- font strikethrough -->
|
|
|
+ <xsl:if test="Element/Element/FontProperties/Strikeout/@value">
|
|
|
+ <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ </font>
|
|
|
+ </textElement>
|
|
|
+ <text>
|
|
|
+ <xsl:value-of select="Element/Element/TextData" />
|
|
|
+ </text>
|
|
|
+ </staticText>
|
|
|
+ </xsl:when>
|
|
|
+ <!-- textField -->
|
|
|
+ <xsl:when test="$type='FieldElement'">
|
|
|
+ <textField isStretchWithOverflow="true" isBlankWhenNull="true">
|
|
|
+ <reportElement stretchType="RelativeToTallestObject"
|
|
|
+ mode="Opaque">
|
|
|
+ <!-- position -->
|
|
|
+ <xsl:attribute name="x">
|
|
|
+ <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="y">
|
|
|
+ <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="width">
|
|
|
+ <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="height">
|
|
|
+ <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </reportElement>
|
|
|
+ <!-- border -->
|
|
|
+ <box topPadding="2" leftPadding="2" bottomPadding="2"
|
|
|
+ rightPadding="2">
|
|
|
+ <pen lineWidth="0.2" />
|
|
|
+ <topPen lineWidth="0.2" />
|
|
|
+ <leftPen lineWidth="0.2" />
|
|
|
+ <bottomPen lineWidth="0.2" />
|
|
|
+ <rightPen lineWidth="0.2" />
|
|
|
+ </box>
|
|
|
+ <!-- align -->
|
|
|
+ <textElement verticalAlignment="Middle">
|
|
|
+ <xsl:variable name="textAlignment"
|
|
|
+ select="CommonProperties/HorizontalAlign/@value" />
|
|
|
+ <!-- horizontal align -->
|
|
|
+ <xsl:if test="$textAlignment">
|
|
|
+ <xsl:attribute name="textAlignment">
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$textAlignment='1'">Left</xsl:when>
|
|
|
+ <xsl:when test="$textAlignment='2'">Center</xsl:when>
|
|
|
+ <xsl:when test="$textAlignment='3'">Right</xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- font -->
|
|
|
+ <font fontName="Microsoft YaHei UI">
|
|
|
+ <!-- font size -->
|
|
|
+ <xsl:if test="FontProperties/FontSize">
|
|
|
+ <xsl:attribute name="size"><xsl:value-of
|
|
|
+ select="round(FontProperties/FontSize/@value div $positionRate * 0.75)" /></xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- font style -->
|
|
|
+ <xsl:variable name="fontStyle" select="FontProperties/FontStyle/@value" />
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$fontStyle mod 4 ='1'">
|
|
|
+ <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$fontStyle mod 4 ='2'">
|
|
|
+ <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$fontStyle mod 4 ='3'">
|
|
|
+ <xsl:attribute name="isBold">true</xsl:attribute>
|
|
|
+ <xsl:attribute name="isItalic">true</xsl:attribute>
|
|
|
+ </xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ <!-- font underline -->
|
|
|
+ <xsl:if test="FontProperties/Underline/@value">
|
|
|
+ <xsl:attribute name="isUnderline">true</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ <!-- font strikethrough -->
|
|
|
+ <xsl:if test="FontProperties/Strikeout/@value">
|
|
|
+ <xsl:attribute name="isStrikeThrough">true</xsl:attribute>
|
|
|
+ </xsl:if>
|
|
|
+ </font>
|
|
|
+ </textElement>
|
|
|
+ <!-- textFieldExpression -->
|
|
|
+ <xsl:if test="Reference">
|
|
|
+ <xsl:variable name="type" select="Reference/@type" />
|
|
|
+ <xsl:variable name="value" select="Reference/@value" />
|
|
|
+ <textFieldExpression>
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$type='DatabaseField'">
|
|
|
+ <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$type='FormulaField'">
|
|
|
+ <xsl:value-of select="concat('@FormulaField ',$value)" />
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:when test="$type='SpecialVarField'">
|
|
|
+ <xsl:value-of select="concat('@SpecialVarField ',$value)" />
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </textFieldExpression>
|
|
|
+ </xsl:if>
|
|
|
+ </textField>
|
|
|
+ </xsl:when>
|
|
|
+ <!-- subreport -->
|
|
|
+ <xsl:when test="$type='Subreport'">
|
|
|
+ <subreport>
|
|
|
+ <reportElement mode="Opaque">
|
|
|
+ <!-- position -->
|
|
|
+ <xsl:attribute name="x">
|
|
|
+ <xsl:value-of select="round(@x_position div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="y">
|
|
|
+ <xsl:value-of select="round(@y_position div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="width">
|
|
|
+ <xsl:value-of select="round(@width div $positionRate)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <xsl:attribute name="height">
|
|
|
+ <xsl:value-of select="round(@height div $positionRate * 1.2)" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </reportElement>
|
|
|
+ <!-- subreportParameter -->
|
|
|
+ <xsl:for-each select="SubreportLinks/SubreportLink">
|
|
|
+ <subreportParameter>
|
|
|
+ <xsl:variable name="type" select="Reference/@type" />
|
|
|
+ <xsl:variable name="value" select="Reference/@value" />
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="$type='DatabaseField'">
|
|
|
+ <xsl:attribute name="name">
|
|
|
+ <xsl:value-of select="$value" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <subreportParameterExpression>
|
|
|
+ <xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
+ </subreportParameterExpression>
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <xsl:attribute name="name">
|
|
|
+ <xsl:value-of select="$value" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <subreportParameterExpression>
|
|
|
+ <xsl:value-of select="concat('@Unknown ',$value)" />
|
|
|
+ </subreportParameterExpression>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </subreportParameter>
|
|
|
+ </xsl:for-each>
|
|
|
+ <connectionExpression>
|
|
|
+ <![CDATA[$P{REPORT_CONNECTION}]]>
|
|
|
+ </connectionExpression>
|
|
|
+ <!-- sub id <= replace with report name -->
|
|
|
+ <id>
|
|
|
+ <xsl:value-of select="SubreportProperties/Id/@value" />
|
|
|
+ </id>
|
|
|
+ <subreportExpression></subreportExpression>
|
|
|
+ </subreport>
|
|
|
+ </xsl:when>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:template>
|
|
|
</xsl:stylesheet>
|