@ -11,6 +11,7 @@ xmlns="http://jasperreports.sourceforge.net/jasperreports">
@@ -11,6 +11,7 @@ xmlns="http://jasperreports.sourceforge.net/jasperreports">
<xsl:param name= "seitenbreite" select= "842" />
<xsl:param name= "seitenhoehe" select= "595" />
<xsl:param name= "seitenrand" select= "12" />
<xsl:param name= "topMargin" select= "12" />
<xsl:param name= "bottomMargin" select= "12" />
<xsl:param name= "isIgnorePagination" select= "'true'" />
<xsl:param name= "orientation" select= "'Landscape'" />
@ -32,7 +33,7 @@ orientation="{$orientation}"
@@ -32,7 +33,7 @@ orientation="{$orientation}"
columnWidth="{$druckbreite}"
leftMargin="{$seitenrand}"
rightMargin="{$seitenrand}"
topMargin="{$seitenrand }"
topMargin="{$topMargin }"
bottomMargin="{$bottomMargin}"
isIgnorePagination="{$isIgnorePagination}" >
<xsl:call-template name= "jr_properties" />
@ -45,7 +46,10 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -45,7 +46,10 @@ isIgnorePagination="{$isIgnorePagination}" >
<!-- <property name="com.jaspersoft.studio.property.dataset.dialog.DatasetDialog.sash.w1" value="466"/>
<property name= "com.jaspersoft.studio.property.dataset.dialog.DatasetDialog.sash.w2" value= "522" /> -->
<template > <xsl:value-of select= "concat('"',$stylesFile,'"')" /> </template>
<xsl:call-template name= "jr_styles" />
<xsl:call-template name= "jr_styles" >
<xsl:with-param name= "ergebniselementOrdnr" select= "$ergebniselementOrdnr" />
</xsl:call-template>
<xsl:call-template name= "querystring" >
<xsl:with-param name= "ordnr" select= "$ergebniselementOrdnr" />
</xsl:call-template>
@ -376,7 +380,7 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -376,7 +380,7 @@ isIgnorePagination="{$isIgnorePagination}" >
<xsl:call-template name= "search_replace" >
<xsl:with-param name= "string" > <xsl:value-of select= "$feldname_ohne_umbruch" /> </xsl:with-param>
<xsl:with-param name= "search" > <xsl:text > \n</xsl:text> </xsl:with-param>
<xsl:with-param name= "replace" > <xsl:text > </xsl:text> </xsl:with-param>
<xsl:with-param name= "replace" > <xsl:text > </xsl:text> </xsl:with-param>
</xsl:call-template>
</xsl:variable>
<xsl:call-template name= "search_replace" >
@ -425,8 +429,9 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -425,8 +429,9 @@ isIgnorePagination="{$isIgnorePagination}" >
<xsl:variable name= "ndefbreite" > <xsl:value-of select= "count(/ergebnisse/ergebnis/ergebniselement[@ordnr=$ergebniselementOrdnr]/sqlerg/headers/header[ @width = '' and not(starts-with(f_name,'hidden')) and not(starts-with(f_name,'next'))])" /> </xsl:variable>
<xsl:variable name= "gesamtbreite" > <xsl:value-of select= "$defbreite+($ndefbreite* $std_spaltenbreite)" /> </xsl:variable>
<xsl:variable name= "width" > <xsl:value-of select= "/ergebnisse/ergebnis/ergebniselement[@ordnr=$ergebniselementOrdnr]/sqlerg/headers/header[@id=$colId]/@width" /> </xsl:variable>
<xsl:comment > <xsl:value-of select= "concat('defbreite=',$defbreite)" /> </xsl:comment>
<xsl:choose >
<xsl:when test= "($colCount - 1)=$colId" >
<xsl:when test= "($colCount - 1) =$colId " >
<!-- letzte Spalte -->
<xsl:value-of select= "$druckbreite - $previousX" />
</xsl:when>
@ -500,17 +505,13 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -500,17 +505,13 @@ isIgnorePagination="{$isIgnorePagination}" >
</xsl:variable>
<xsl:if test= "normalize-space($jasperFieldname)!=''" > <!-- keine leeren Feldnamen -->
<textField isStretchWithOverflow= "true" isBlankWhenNull= "true" >
<xsl:attribute name= "pattern" >
<xsl:call-template name= "tableCellPattern" >
<xsl:with-param name= "fieldType" select= "$fieldType" />
</xsl:call-template>
</xsl:attribute>
<reportElement stretchType= "ContainerHeight" x= "{$x}" y= "0" width= "{$width}" height= "{$height}" >
<xsl:attribute name= "style" >
<xsl:call-template name= "getTableRowStyle" >
<xsl:with-param name= "flavorTableRowStyle" select= "$flavorTableRowStyle" />
<xsl:with-param name= "tableRowLevel" select= "$tableRowLevel" />
<xsl:with-param name= "ergebnisElementOrdnr" select= "$ergebnisElementOrdnr" />
<xsl:with-param name= "fieldType" select= "$fieldType" />
</xsl:call-template>
</xsl:attribute>
<xsl:if test= "$flavorTableRowStyle='treeTable'" >
@ -526,6 +527,11 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -526,6 +527,11 @@ isIgnorePagination="{$isIgnorePagination}" >
<textElement textAlignment= "Left" />
</xsl:if>
<textFieldExpression > <xsl:value-of select= "concat('$F{',$fldPrefix,$jasperFieldname,'}')" /> </textFieldExpression>
<xsl:call-template name= "tableCellPatternExpression" >
<xsl:with-param name= "fieldType" select= "$fieldType" />
<xsl:with-param name= "ergebnisElementOrdnr" select= "$ergebnisElementOrdnr" />
<xsl:with-param name= "fieldName" select= "$fieldName" />
</xsl:call-template>
</textField>
</xsl:if>
</xsl:template>
@ -563,14 +569,27 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -563,14 +569,27 @@ isIgnorePagination="{$isIgnorePagination}" >
<xsl:param name= "zeilenhoehe" select= "30" />
<xsl:param name= "ordnr" select= "0" />
<xsl:param name= "y_offset" select= "0" />
<xsl:for-each select= "/ergebnisse/ergebnis/ergebniselement[@ordnr=$ordnr]" > <!-- derzeit nur eine Tabelle erlaubt -->
<xsl:for-each select= "/ergebnisse/ergebnis/ergebniselement[@ordnr=$ordnr]" >
<xsl:choose >
<xsl:when test= "sqlerg/headers/@hasAggregationHeaders='true'" >
<!-- verschachtelter Header -->
<xsl:variable name= "colCount" > <xsl:value-of select= "count(sqlerg/aggregationHeaders/tr)" /> </xsl:variable>
<xsl:variable name= "totalColCount" > <xsl:value-of select= "sqlerg/headers/@count" /> </xsl:variable>
<xsl:variable name= "rowCount" > <xsl:value-of select= "count(sqlerg/aggregationHeaders/tr)" /> </xsl:variable>
<xsl:for-each select= "sqlerg/aggregationHeaders/tr" >
<xsl:variable name= "rowCounter" select= "position()-1" />
<xsl:variable name= "currentRowColCount" > <xsl:value-of select= "count(th[ @isHidden='false'])" /> </xsl:variable>
<xsl:variable name= "colCount" >
<xsl:choose >
<xsl:when test= "($rowCounter - 1)=$rowCount" >
<xsl:value-of select= "$totalColCount" />
</xsl:when>
<xsl:otherwise >
<xsl:value-of select= "$totalColCount" />
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:for-each select= "th" >
<xsl:variable name= "colId" > <xsl:value-of select= "position()-1" /> </xsl:variable>
<xsl:if test= "@isHidden='false'" >
@ -584,6 +603,9 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -584,6 +603,9 @@ isIgnorePagination="{$isIgnorePagination}" >
<xsl:with-param name= "colCount" select= "$colCount" />
</xsl:call-template>
</xsl:variable>
<xsl:comment > <xsl:text > columnX=</xsl:text> <xsl:value-of select= "$columnX" /> </xsl:comment>
<xsl:comment > <xsl:text > colCount=</xsl:text> <xsl:value-of select= "$colCount" /> </xsl:comment>
<xsl:comment > <xsl:text > druckbreite=</xsl:text> <xsl:value-of select= "$druckbreite" /> </xsl:comment>
<xsl:variable name= "columnWidth" >
<xsl:call-template name= "getColumnwidth" >
<xsl:with-param name= "druckbreite" select= "$druckbreite" />
@ -595,6 +617,7 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -595,6 +617,7 @@ isIgnorePagination="{$isIgnorePagination}" >
</xsl:call-template>
</xsl:variable>
<xsl:comment > <xsl:text > columnWidth=</xsl:text> <xsl:value-of select= "$columnWidth" /> </xsl:comment>
<xsl:variable name= "rowspan" >
<xsl:choose >
@ -618,7 +641,7 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -618,7 +641,7 @@ isIgnorePagination="{$isIgnorePagination}" >
</xsl:variable>
<textField isStretchWithOverflow= "true" >
<reportElement positionType= "Float" style= "TableColumnHeader" mode= "Opaque" stretchType= "ContainerHeight"
<reportElement style= "TableColumnHeader" mode= "Opaque" stretchType= "ContainerHeight"
x="{$columnX}" y="{$y_offset+( $rowCounter * $zeilenhoehe )}" width="{$columnWidth * $colspan}" height="{$zeilenhoehe*$rowspan}" />
<textFieldExpression > <xsl:text > "</xsl:text>
<xsl:call-template name= "newline_to_backslash_n" >
@ -727,29 +750,20 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -727,29 +750,20 @@ isIgnorePagination="{$isIgnorePagination}" >
</textField>
</xsl:if>
<!-- Legende -->
<textField >
<reportElement style= "LegendLabel" x= "0" y= "{$subReportTitleHeight}" width= "{$druckbreite}" height= "{$legendLabelHeight}" />
<textElement verticalAlignment= "Bottom" >
<font isBold= "true" />
</textElement>
<textFieldExpression > <![CDATA["Filterkriterien: "]]> </textFieldExpression>
</textField>
<textField isStretchWithOverflow= "true" >
<reportElement style= "LegendContent" isPrintWhenDetailOverflows= "true" x= "0" y= "{$subReportTitleHeight + $legendLabelHeight}" width= "{$druckbreite}" height= "{$legendContentHeight}" />
<box padding= "5" />
<textFieldExpression >
<xsl:call-template name= "getLegendExpression" >
<xsl:with-param name= "ergebniselementOrdnr" select= "$ergebniselementOrdnr" />
<xsl:call-template name= "legendLabelAndContent" >
<xsl:with-param name= "ergebniselementOrdnr" select= "$ergebniselementOrdnr" />
<xsl:with-param name= "subReportTitleHeight" select= "$subReportTitleHeight" />
<xsl:with-param name= "druckbreite" select= "$druckbreite" />
<xsl:with-param name= "legendLabelHeight" select= "$legendLabelHeight" />
<xsl:with-param name= "legendContentHeight" select= "$legendContentHeight" />
</xsl:call-template>
<xsl:text disable-output-escaping= "yes" > <![CDATA[ +"Datenstand: "+ $F{standdatum} + "; " + "Erstellt: "+ DATEFORMAT( TODAY(), "dd.MM.YYYY")]]> </xsl:text> </textFieldExpression>
</textField>
</band>
<band height= "{$hinweisContentHeight}" >
<printWhenExpression > <![CDATA[$F{Hinweis}.length() >0]]> </printWhenExpression>
<!-- hinweis -->
<textField isStretchWithOverflow= "true" >
<reportElement style= "HinweisContent" positionType= "Float" isPrintWhenDetailOverflows= "true" x= "0" y= "0" width= "{$druckbreite}" height= "{$hinweisContentHeight}" />
<box topPadding= "10" leftPadding= "2" bottomPadding= "10" rightPadding= "2" />
<textElement verticalAlignment= "Middle" />
<textFieldExpression >
<xsl:text disable-output-escaping= "yes" > <![CDATA[$F{Hinweis}]]> </xsl:text> </textFieldExpression>
@ -834,6 +848,7 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -834,6 +848,7 @@ isIgnorePagination="{$isIgnorePagination}" >
<xsl:param name= "flavorTableRowStyle" />
<xsl:param name= "tableRowLevel" />
<xsl:param name= "ergebnisElementOrdnr" select= "0" />
<xsl:param name= "fieldType" />
<xsl:choose >
<xsl:when test= "$flavorTableRowStyle='listAlternatingBg'" >
<xsl:text > TableRowDetail</xsl:text>
@ -954,27 +969,31 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -954,27 +969,31 @@ isIgnorePagination="{$isIgnorePagination}" >
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name= "tableCellPattern" >
<xsl:template name= "tableCellPatternExpression " >
<xsl:param name= "fieldType" />
<xsl:param name= "ergebnisElementOrdnr" />
<xsl:param name= "fieldName" />
<patternExpression >
<xsl:choose >
<xsl:when test= "$fieldType='4'" > <!-- integer -->
<xsl:text > 0</xsl:text>
<xsl:text > "#,## 0" </xsl:text>
</xsl:when>
<xsl:when test= "$fieldType='3'" > <!-- decimal -->
<xsl:text > #,##0.00;-#,##0.00</xsl:text>
<xsl:text > " #,##0.00;-#,##0.00" </xsl:text>
</xsl:when>
<xsl:when test= "$fieldType='6'" > <!-- date -->
<xsl:text > dd.MM.yyyy</xsl:text>
<xsl:text > " dd.MM.yyyy" </xsl:text>
</xsl:when>
<xsl:when test= "$fieldType='8'" > <!-- timestamp -->
<xsl:text > dd.MM.yyyy hh:mm:ss</xsl:text>
<xsl:text > " dd.MM.yyyy hh:mm:ss" </xsl:text>
</xsl:when>
<xsl:when test= "$fieldType='9'" > <!-- time -->
<xsl:text > hh:mm:ss</xsl:text>
<xsl:text > " hh:mm:ss" </xsl:text>
</xsl:when>
<xsl:otherwise >
</xsl:otherwise>
</xsl:choose>
</patternExpression>
</xsl:template>
<xsl:template name= "newline_to_backslash_n" >
<xsl:param name= "string" />
@ -991,4 +1010,30 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -991,4 +1010,30 @@ isIgnorePagination="{$isIgnorePagination}" >
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name= "legendLabelAndContent" >
<xsl:param name= "ergebniselementOrdnr" select= "0" />
<xsl:param name= "subReportTitleHeight" select= "10" />
<xsl:param name= "druckbreite" select= "842" />
<xsl:param name= "legendLabelHeight" select= "10" />
<xsl:param name= "legendContentHeight" select= "50" />
<textField >
<reportElement style= "LegendLabel" x= "0" y= "{$subReportTitleHeight}" width= "{$druckbreite}" height= "{$legendLabelHeight}" />
<textElement verticalAlignment= "Bottom" >
<font isBold= "true" />
</textElement>
<textFieldExpression > <![CDATA["Filterkriterien: "]]> </textFieldExpression>
</textField>
<textField isStretchWithOverflow= "true" >
<reportElement style= "LegendContent" isPrintWhenDetailOverflows= "true" x= "0" y= "{$subReportTitleHeight + $legendLabelHeight}" width= "{$druckbreite}" height= "{$legendContentHeight}" />
<box topPadding= "10" leftPadding= "2" bottomPadding= "10" rightPadding= "2" />
<textFieldExpression >
<xsl:call-template name= "getLegendExpression" >
<xsl:with-param name= "ergebniselementOrdnr" select= "$ergebniselementOrdnr" />
</xsl:call-template>
<xsl:text disable-output-escaping= "yes" > <![CDATA[ +"Datenstand: "+ $F{standdatum} + "; " + "Erstellt: "+ DATEFORMAT( TODAY(), "dd.MM.YYYY")]]> </xsl:text> </textFieldExpression>
</textField>
</xsl:template>
</xsl:stylesheet>