|
|
@@ -5,7 +5,7 @@
|
|
|
|
|
|
<xsl:output method="xml" version="1.0" encoding="UTF-8"
|
|
|
indent="yes"
|
|
|
- cdata-section-elements="parameterDescription defaultValueExpression queryString text textFieldExpression subreportParameterExpression connectionExpression subreportExpression" />
|
|
|
+ cdata-section-elements="parameterDescription defaultValueExpression queryString variableExpression text textFieldExpression subreportParameterExpression connectionExpression subreportExpression" />
|
|
|
<!-- position rate from crystal to jasper -->
|
|
|
|
|
|
<xsl:variable name="positionRate">
|
|
|
@@ -39,6 +39,7 @@
|
|
|
<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>
|
|
|
@@ -49,6 +50,7 @@
|
|
|
<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-')" />
|
|
|
@@ -97,6 +99,43 @@
|
|
|
</xsl:attribute>
|
|
|
</field>
|
|
|
</xsl:for-each>
|
|
|
+
|
|
|
+ <!-- variables -->
|
|
|
+ <!-- FormulaFields to variable -->
|
|
|
+ <xsl:for-each select="FormulaFields/Field[@type='FormulaField']">
|
|
|
+ <variable>
|
|
|
+ <xsl:attribute name="name">
|
|
|
+ <xsl:value-of select="Name/@value" />
|
|
|
+ </xsl:attribute>
|
|
|
+ <variableExpression>
|
|
|
+ <xsl:value-of select="TextData" />
|
|
|
+ </variableExpression>
|
|
|
+ </variable>
|
|
|
+ </xsl:for-each>
|
|
|
+ <!-- PromptFields(don't start with 'Pm-') to variable -->
|
|
|
+ <xsl:for-each select="PromptFields/Field[@type='PromptVarField']">
|
|
|
+ <xsl:variable name="name" select="Name/@value" />
|
|
|
+ <xsl:choose>
|
|
|
+ <xsl:when test="substring-after($name,'Pm-')">
|
|
|
+ </xsl:when>
|
|
|
+ <xsl:otherwise>
|
|
|
+ <variable>
|
|
|
+ <xsl:attribute name="name">
|
|
|
+ <xsl:value-of select="$name" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </variable>
|
|
|
+ </xsl:otherwise>
|
|
|
+ </xsl:choose>
|
|
|
+ </xsl:for-each>
|
|
|
+ <!-- SpecialVarField to variable -->
|
|
|
+ <xsl:for-each select="//Reference[@type='SpecialVarField']">
|
|
|
+ <variable>
|
|
|
+ <xsl:attribute name="name">
|
|
|
+ <xsl:value-of select="@value" />
|
|
|
+ </xsl:attribute>
|
|
|
+ </variable>
|
|
|
+ </xsl:for-each>
|
|
|
+
|
|
|
<!-- title -->
|
|
|
<xsl:if test="AreaPair[@type='ReportAreaPair']/Area[@type='ReportHeader']">
|
|
|
<title>
|
|
|
@@ -171,98 +210,42 @@
|
|
|
<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> -->
|
|
|
+ <!-- <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> -->
|
|
|
+ <!-- <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'">
|
|
|
@@ -425,10 +408,10 @@
|
|
|
<xsl:value-of select="concat('$F{',$value,'}')" />
|
|
|
</xsl:when>
|
|
|
<xsl:when test="$type='FormulaField'">
|
|
|
- <xsl:value-of select="concat('@FormulaField ',$value)" />
|
|
|
+ <xsl:value-of select="concat('$V{',substring($value,2),'}')" />
|
|
|
</xsl:when>
|
|
|
<xsl:when test="$type='SpecialVarField'">
|
|
|
- <xsl:value-of select="concat('@SpecialVarField ',$value)" />
|
|
|
+ <xsl:value-of select="concat('$V{',$value,'}')" />
|
|
|
</xsl:when>
|
|
|
<xsl:otherwise>
|
|
|
<xsl:value-of select="concat('@Unknown ',$value)" />
|