@ -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= "bottomMargin" select= "12" />
<xsl:param name= "isIgnorePagination" select= "'true'" />
<xsl:param name= "orientation" select= "'Landscape'" />
<xsl:param name= "stylesFile" select= "'simple_table.jrtx'" />
@ -32,7 +33,7 @@ columnWidth="{$druckbreite}"
@@ -32,7 +33,7 @@ columnWidth="{$druckbreite}"
leftMargin="{$seitenrand}"
rightMargin="{$seitenrand}"
topMargin="{$seitenrand}"
bottomMargin="{$seitenrand }"
bottomMargin="{$bottomMargin }"
isIgnorePagination="{$isIgnorePagination}" >
<xsl:call-template name= "jr_properties" />
<property name= "net.sf.jasperreports.export.xls.exclude.origin.band.1" value= "pageHeader" />
@ -87,21 +88,25 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -87,21 +88,25 @@ isIgnorePagination="{$isIgnorePagination}" >
</xsl:variable>
<band height= "{$std_zeilenhoehe_tablerow}" splitType= "Stretch" >
<xsl:variable name= "colCount" > <xsl:value-of select= "count(sqlerg/headers/header[not(starts-with(f_name,'hidden')) and not(starts-with(f_name,'next')) ])" /> </xsl:variable>
<xsl:for-each select= "sqlerg/headers/header[not(starts-with(f_name,'hidden')) and not(starts-with(f_name,'next')) ]" >
<xsl:variable name= "columnWidth " >
<xsl:call-template name= "getColumnwidth " >
<xsl:variable name= "columnX " >
<xsl:call-template name= "getColumnX " >
<xsl:with-param name= "druckbreite" select= "$druckbreite" />
<xsl:with-param name= "std_spaltenbreite" select= "$std_spaltenbreite" />
<xsl:with-param name= "ergebniselementOrdnr" select= "$ergebniselementOrdnr" />
<xsl:with-param name= "colId" select= "@id" />
<xsl:with-param name= "colCount" select= "$colCount" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name= "columnX " >
<xsl:call-template name= "getColumnX " >
<xsl:variable name= "columnWidth " >
<xsl:call-template name= "getColumnwidth " >
<xsl:with-param name= "druckbreite" select= "$druckbreite" />
<xsl:with-param name= "std_spaltenbreite" select= "$std_spaltenbreite" />
<xsl:with-param name= "ergebniselementOrdnr" select= "$ergebniselementOrdnr" />
<xsl:with-param name= "colId" select= "@id" />
<xsl:with-param name= "colCount" select= "$colCount" />
<xsl:with-param name= "previousX" select= "$columnX" />
</xsl:call-template>
</xsl:variable>
<xsl:choose >
@ -386,6 +391,7 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -386,6 +391,7 @@ isIgnorePagination="{$isIgnorePagination}" >
<xsl:param name= "std_spaltenbreite" />
<xsl:param name= "ergebniselementOrdnr" />
<xsl:param name= "colId" />
<xsl:param name= "colCount" />
<xsl:variable name= "x" > <xsl:text > 0</xsl:text>
<xsl:for-each select= "/ergebnisse/ergebnis/ergebniselement[@ordnr=$ergebniselementOrdnr]/sqlerg/headers/header[ @width > 0 and not(starts-with(f_name,'hidden')) and not(starts-with(f_name,'next')) and @id < $colId ]" >
<xsl:variable name= "previousColumnWidth" >
@ -394,6 +400,9 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -394,6 +400,9 @@ isIgnorePagination="{$isIgnorePagination}" >
<xsl:with-param name= "std_spaltenbreite" select= "$std_spaltenbreite" />
<xsl:with-param name= "ergebniselementOrdnr" select= "$ergebniselementOrdnr" />
<xsl:with-param name= "colId" select= "@id" />
<xsl:with-param name= "colCount" select= "$colCount" />
<xsl:with-param name= "previousX" select= "0" />
</xsl:call-template>
</xsl:variable>
<xsl:text > +</xsl:text> <xsl:value-of select = "$previousColumnWidth" />
@ -410,11 +419,17 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -410,11 +419,17 @@ isIgnorePagination="{$isIgnorePagination}" >
<xsl:param name= "std_spaltenbreite" />
<xsl:param name= "ergebniselementOrdnr" />
<xsl:param name= "colId" />
<xsl:param name= "colCount" />
<xsl:param name= "previousX" />
<xsl:variable name= "defbreite" > <xsl:value-of select= "sum(/ergebnisse/ergebnis/ergebniselement[@ordnr=$ergebniselementOrdnr]/sqlerg/headers/header[ @width > 0 and not(starts-with(f_name,'hidden')) and not(starts-with(f_name,'next')) ]/@width )" /> </xsl:variable>
<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:choose >
<xsl:when test= "($colCount - 1)=$colId" >
<!-- letzte Spalte -->
<xsl:value-of select= "$druckbreite - $previousX" />
</xsl:when>
<xsl:when test= "$width != ''" >
<xsl:variable name= "spbreite" > <xsl:value-of select= "$druckbreite*($width div $gesamtbreite)" />
</xsl:variable>
@ -552,29 +567,35 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -552,29 +567,35 @@ isIgnorePagination="{$isIgnorePagination}" >
<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:for-each select= "sqlerg/aggregationHeaders/tr" >
<xsl:variable name= "rowCounter" select= "position()-1" />
<xsl:for-each select= "th" >
<xsl:variable name= "colId" > <xsl:value-of select= "position()-1" /> </xsl:variable>
<xsl:if test= "@isHidden='false'" >
<xsl:comment > <xsl:text > colId=</xsl:text> <xsl:value-of select= "$colId" /> </xsl:comment>
<xsl:variable name= "columnWidth" >
<xsl:call-template name= "getColumnwidth" >
<xsl:variable name= "columnX" >
<xsl:call-template name= "getColumnX" >
<xsl:with-param name= "druckbreite" select= "$druckbreite" />
<xsl:with-param name= "std_spaltenbreite" select= "$std_spaltenbreite" />
<xsl:with-param name= "ergebniselementOrdnr" select= "$ordnr" />
<xsl:with-param name= "colId" select= "$colId" />
<xsl:with-param name= "colCount" select= "$colCount" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name= "columnX " >
<xsl:call-template name= "getColumnX " >
<xsl:variable name= "columnWidth " >
<xsl:call-template name= "getColumnwidth " >
<xsl:with-param name= "druckbreite" select= "$druckbreite" />
<xsl:with-param name= "std_spaltenbreite" select= "$std_spaltenbreite" />
<xsl:with-param name= "ergebniselementOrdnr" select= "$ordnr" />
<xsl:with-param name= "colId" select= "$colId" />
<xsl:with-param name= "colCount" select= "$colCount" />
<xsl:with-param name= "previousX" select= "$columnX" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name= "rowspan" >
<xsl:choose >
<xsl:when test= "@rowspan >1" >
@ -595,40 +616,62 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -595,40 +616,62 @@ isIgnorePagination="{$isIgnorePagination}" >
</xsl:otherwise>
</xsl:choose>
</xsl:variable>
<staticText >
<reportElement positionType= "Float" style= "TableColumnHeader" mode= "Opaque" x= "{$columnX}" y= "{$y_offset+( $rowCounter * $zeilenhoehe )}" width= "{$columnWidth * $colspan}" height= "{$zeilenhoehe*$rowspan}" />
<text > <xsl:call-template name= "getColHeaderText" >
<xsl:with-param name= "header_wert" select= "." /> </xsl:call-template> </text>
</staticText>
<textField isStretchWithOverflow= "true" >
<reportElement positionType= "Float" 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" >
<xsl:with-param name= "string" select= "." />
</xsl:call-template>
<xsl:text > "</xsl:text>
</textFieldExpression>
</textField>
</xsl:if>
</xsl:for-each>
</xsl:for-each>
</xsl:when>
<xsl:otherwise >
<xsl:variable name= "colCount" > <xsl:value-of select= "count(sqlerg/headers/header[not(starts-with(f_name,'hidden')) and not(starts-with(f_name,'next')) ])" /> </xsl:variable>
<xsl:for-each select= "sqlerg/headers/header[not(starts-with(f_name,'hidden')) and not(starts-with(f_name,'next')) ]" >
<xsl:variable name= "columnWidth" >
<xsl:call-template name= "getColumnwidth " >
<xsl:variable name= "columnX " >
<xsl:call-template name= "getColumnX " >
<xsl:with-param name= "druckbreite" select= "$druckbreite" />
<xsl:with-param name= "std_spaltenbreite" select= "$std_spaltenbreite" />
<xsl:with-param name= "ergebniselementOrdnr" select= "$ordnr" />
<xsl:with-param name= "colId" select= "@id" />
<xsl:with-param name= "colCount" select= "$colCount" />
</xsl:call-template>
</xsl:variable>
<xsl:variable name= "columnX " >
<xsl:call-template name= "getColumnX " >
<xsl:variable name= "columnWidth " >
<xsl:call-template name= "getColumnwidth " >
<xsl:with-param name= "druckbreite" select= "$druckbreite" />
<xsl:with-param name= "std_spaltenbreite" select= "$std_spaltenbreite" />
<xsl:with-param name= "ergebniselementOrdnr" select= "$ordnr" />
<xsl:with-param name= "colId" select= "@id" />
<xsl:with-param name= "colCount" select= "$colCount" />
<xsl:with-param name= "previousX" select= "$columnX" />
</xsl:call-template>
</xsl:variable>
<staticText >
<reportElement style= "TableColumnHeader" mode= "Opaque" x= "{$columnX}" y= "{$y_offset}" width= "{$columnWidth}" height= "{$zeilenhoehe}" />
<text > <xsl:call-template name= "getColHeaderText" >
<xsl:with-param name= "header_wert" select= "wert" /> </xsl:call-template> </text>
</staticText>
<textField isStretchWithOverflow= "true" >
<reportElement positionType= "Float" style= "TableColumnHeader" mode= "Opaque" stretchType= "ContainerHeight"
x="{$columnX}" y="{$y_offset}" width="{$columnWidth}" height="{$zeilenhoehe}" />
<textFieldExpression > <xsl:text > "</xsl:text> <!-- <xsl:call - template name="getColHeaderText">
<xsl:with-param name= "header_wert" select= "." /> </xsl:call-template> -->
<xsl:call-template name= "newline_to_backslash_n" >
<xsl:with-param name= "string" select= "wert" />
</xsl:call-template>
<xsl:text > "</xsl:text>
</textFieldExpression>
</textField>
</xsl:for-each>
</xsl:otherwise>
</xsl:choose>
@ -675,6 +718,7 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -675,6 +718,7 @@ isIgnorePagination="{$isIgnorePagination}" >
<groupExpression > <![CDATA[$V{tabellennr}]]> </groupExpression>
<groupHeader >
<band height= "{$legendLabelHeight+$legendContentHeight + $subReportTitleHeight}" >
<property name= "com.jaspersoft.studio.layout" value= "com.jaspersoft.studio.editor.layout.spreadsheet.SpreadsheetLayout" />
<!-- subReportTitle -->
<xsl:if test= "$isMacroReport = 'true'" >
<textField >
@ -685,7 +729,9 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -685,7 +729,9 @@ isIgnorePagination="{$isIgnorePagination}" >
<!-- Legende -->
<textField >
<reportElement style= "LegendLabel" x= "0" y= "{$subReportTitleHeight}" width= "{$druckbreite}" height= "{$legendLabelHeight}" />
<textElement verticalAlignment= "Bottom" />
<textElement verticalAlignment= "Bottom" >
<font isBold= "true" />
</textElement>
<textFieldExpression > <![CDATA["Filterkriterien: "]]> </textFieldExpression>
</textField>
@ -700,18 +746,17 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -700,18 +746,17 @@ isIgnorePagination="{$isIgnorePagination}" >
</textField>
</band>
<band height= "{$hinweisContentHeight}" >
<printWhenExpression > <![CDATA[$F{Hinweis}!="" ]]> </printWhenExpression>
<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 padding= "5" />
<textElement verticalAlignment= "Middle" />
<textFieldExpression >
<xsl:text disable-output-escaping= "yes" > <![CDATA[$F{Hinweis}]]> </xsl:text> </textFieldExpression>
</textField>
</band>
<!-- nun Spaltenüberschriften -->
<band >
<band splitType= "Stretch" >
<xsl:attribute name= "height" >
<xsl:call-template name= "getZeilenhoeheTableHeader" >
<xsl:with-param name= "ordnr" select= "$ergebniselementOrdnr" />
@ -931,4 +976,19 @@ isIgnorePagination="{$isIgnorePagination}" >
@@ -931,4 +976,19 @@ isIgnorePagination="{$isIgnorePagination}" >
</xsl:otherwise>
</xsl:choose>
</xsl:template>
<xsl:template name= "newline_to_backslash_n" >
<xsl:param name= "string" />
<xsl:choose >
<xsl:when test= "contains($string,' ')" >
<xsl:value-of select= "substring-before($string,' ')" />
<xsl:text > \n</xsl:text>
<xsl:call-template name= "newline_to_backslash_n" >
<xsl:with-param name= "string" select= "substring-after($string,' ')" />
</xsl:call-template>
</xsl:when>
<xsl:otherwise >
<xsl:value-of select= "$string" />
</xsl:otherwise>
</xsl:choose>
</xsl:template>
</xsl:stylesheet>