Daniel Quathamer
1 year ago
3 changed files with 267 additions and 0 deletions
@ -0,0 +1,200 @@ |
|||||||
|
<?xml version="1.0" encoding="UTF-8"?> |
||||||
|
<xsl:stylesheet version="1.0" |
||||||
|
xmlns:xsl="http://www.w3.org/1999/XSL/Transform" |
||||||
|
xmlns="http://jasperreports.sourceforge.net/jasperreports" |
||||||
|
> |
||||||
|
<xsl:import href="xsl_functions.xsl" /> |
||||||
|
<xsl:import href="rpta_templates.xsl" /> |
||||||
|
|
||||||
|
<xsl:param name="OUTFILE" select="'_sub_'" /> |
||||||
|
<xsl:param name="seitenbreite" select="842" /> |
||||||
|
<xsl:param name="seitenhoehe" select="595" /> |
||||||
|
<xsl:param name="seitenrand" select="12" /> |
||||||
|
<xsl:param name="isIgnorePagination" select="'true'" /> |
||||||
|
<xsl:param name="orientation" select="'Landscape'" /> |
||||||
|
<xsl:param name="stylesFile" select="'simple_table.jrtx'" /> |
||||||
|
<xsl:param name="font" select="'Liberation Sans'" /><!--TODO Arial als style--> |
||||||
|
<!--Die Breite der Tabelle in pixel bei A4 Querformat:--> |
||||||
|
<!-- Wenn keine Spaltenbreite definiert ist, wird 12 (Einheit Applet-Breite) verwendet. --> |
||||||
|
<xsl:param name="std_spaltenbreite" select="'12'" /> |
||||||
|
<xsl:param name="std_zeilenhoehe_header" select="30" /> |
||||||
|
<xsl:param name="std_zeilenhoehe_tablerow" select="20" /> |
||||||
|
|
||||||
|
<!--<xsl:output method="xml" name="xml"/>--> |
||||||
|
<xsl:output method="xml" encoding="UTF-8" name="xml" indent="true" /> |
||||||
|
<!--<xml:output method="xml" name="text" /> |
||||||
|
<xsl:output indent="yes"/>--> |
||||||
|
<xsl:template match="/"> |
||||||
|
<xsl:variable name="druckbreite" select="$seitenbreite - (2 * $seitenrand)"></xsl:variable> |
||||||
|
<xsl:choose> |
||||||
|
<xsl:when test="/ergebnisse/@isMakro='true'"> |
||||||
|
<!-- first create main report--> |
||||||
|
<xsl:call-template name="generateJasperReportMainReport" > |
||||||
|
<xsl:with-param name="isMacroReport" select="'true'" /> |
||||||
|
<xsl:with-param name="ergebniselementOrdnr" select="0" /> |
||||||
|
<xsl:with-param name="druckbreite" select="$druckbreite" /> |
||||||
|
<xsl:with-param name="std_zeilenhoehe_tablerow" select="$std_zeilenhoehe_tablerow" /> |
||||||
|
</xsl:call-template> |
||||||
|
<!--output documents klappt noch nicht--> |
||||||
|
<!-- |
||||||
|
<xsl:for-each select="/ergebnisse/ergebnis/ergebniselement"> |
||||||
|
<xsl:variable name="filename" select="concat($OUTFILE,@ordnr,'.jrxml')"/> |
||||||
|
Generiere <xsl:value-of select="$filename"/><xsl:text> |
||||||
|
</xsl:text> |
||||||
|
<xsl:result-document href="{$filename}" format="text" method="text"> |
||||||
|
<xsl:call-template name="generateJasperReport" > |
||||||
|
<xsl:with-param name="isMacroReport" select="'false'" /> |
||||||
|
<xsl:with-param name="ergebniselementOrdnr" select="@ordnr" /> |
||||||
|
<xsl:with-param name="druckbreite" select="$druckbreite" /> |
||||||
|
</xsl:call-template> |
||||||
|
</xsl:result-document> |
||||||
|
</xsl:for-each> |
||||||
|
--> |
||||||
|
</xsl:when> |
||||||
|
<xsl:otherwise> |
||||||
|
<!--no macro, one single table--> |
||||||
|
<xsl:call-template name="generateJasperReport" > |
||||||
|
<xsl:with-param name="isMacroReport" select="'false'" /> |
||||||
|
<xsl:with-param name="ergebniselementOrdnr" select="0" /> |
||||||
|
<xsl:with-param name="druckbreite" select="$druckbreite" /> |
||||||
|
<xsl:with-param name="std_zeilenhoehe_tablerow" select="$std_zeilenhoehe_tablerow" /> |
||||||
|
</xsl:call-template> |
||||||
|
</xsl:otherwise> |
||||||
|
</xsl:choose> |
||||||
|
</xsl:template> |
||||||
|
|
||||||
|
<xsl:template name="generateJasperReportMainReport"> |
||||||
|
<xsl:param name="isMainReport" select="'true'" /> |
||||||
|
<xsl:param name="ergebniselementOrdnr" select="0" /> |
||||||
|
<xsl:param name="druckbreite" select="812" /> |
||||||
|
<xsl:param name="seitenbreite" select="842" /> |
||||||
|
<xsl:param name="seitenhoehe" select="595" /> |
||||||
|
<xsl:param name="seitenrand" select="12" /> |
||||||
|
<xsl:param name="isIgnorePagination" select="'true'" /> |
||||||
|
<xsl:param name="orientation" select="'Landscape'" /> |
||||||
|
<xsl:param name="stylesFile" select="'simple_table.jrtx'" /> |
||||||
|
<xsl:param name="font" select="'Liberation Sans'" /><!--TODO Arial als style--> |
||||||
|
<!--Die Breite der Tabelle in pixel bei A4 Querformat:--> |
||||||
|
<!-- Wenn keine Spaltenbreite definiert ist, wird 12 (Einheit Applet-Breite) verwendet. --> |
||||||
|
<xsl:param name="std_spaltenbreite" select="'12'" /> |
||||||
|
<xsl:param name="std_zeilenhoehe_header" select="30" /> |
||||||
|
<xsl:param name="std_zeilenhoehe_tablerow" select="20" /> |
||||||
|
|
||||||
|
<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" |
||||||
|
name="{/ergebnisse/ergebnis[@ordnr=$ergebniselementOrdnr]/maskenname}" |
||||||
|
language="groovy" |
||||||
|
pageWidth="{$seitenbreite}" |
||||||
|
pageHeight="{$seitenhoehe}" |
||||||
|
orientation="{$orientation}" |
||||||
|
columnWidth="{$druckbreite}" |
||||||
|
leftMargin="{$seitenrand}" |
||||||
|
rightMargin="{$seitenrand}" |
||||||
|
topMargin="{$seitenrand}" |
||||||
|
bottomMargin="{$seitenrand}" |
||||||
|
isIgnorePagination="{$isIgnorePagination}" |
||||||
|
sectionType="Part"> |
||||||
|
<xsl:call-template name="jr_properties" /> |
||||||
|
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.1" value="pageHeader"/> |
||||||
|
<property name="net.sf.jasperreports.export.xls.exclude.origin.band.2" value="pageFooter"/> |
||||||
|
<property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.1" value="pageHeader"/> |
||||||
|
<property name="net.sf.jasperreports.export.xlsx.exclude.origin.band.2" value="pageFooter"/> |
||||||
|
<!-- zum Testen--> |
||||||
|
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="TUHH_kennz_bericht_ba"/> |
||||||
|
<!--<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="querystring"> |
||||||
|
<xsl:with-param name="ordnr" select="$ergebniselementOrdnr" /> |
||||||
|
<xsl:with-param name="rownr" select="1" /> |
||||||
|
</xsl:call-template> |
||||||
|
<xsl:call-template name="jr_fields_report_level" /> |
||||||
|
<xsl:call-template name="jr_fields" > |
||||||
|
<xsl:with-param name="ergebniselementOrdnr" select="$ergebniselementOrdnr"/> |
||||||
|
<xsl:with-param name="isMacroReport" select="/ergebnisse/@isMakro" /> |
||||||
|
</xsl:call-template> |
||||||
|
<!-- kein Deckblatt --> |
||||||
|
<detail> |
||||||
|
<xsl:for-each select="/ergebnisse/ergebnis/ergebniselement"> |
||||||
|
<xsl:variable name="filename" select="concat(/ergebnisse/makro/@id,$OUTFILE,@ordnr)"/> |
||||||
|
|
||||||
|
<part> |
||||||
|
<partNameExpression><xsl:text>"</xsl:text><xsl:value-of select="@ordnr+1"/><xsl:text> </xsl:text> |
||||||
|
<xsl:call-template name="createExcelSheetname"> |
||||||
|
<xsl:with-param name="mystring" select="../maskenname"/> |
||||||
|
</xsl:call-template> |
||||||
|
<xsl:text>"</xsl:text></partNameExpression> |
||||||
|
<p:subreportPart xmlns:p="http://jasperreports.sourceforge.net/jasperreports/parts" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/parts http://jasperreports.sourceforge.net/xsd/parts.xsd"> |
||||||
|
<subreportParameter name="REPORT_CONNECTION"> |
||||||
|
<subreportParameterExpression><![CDATA[$P{REPORT_CONNECTION}]]></subreportParameterExpression> |
||||||
|
</subreportParameter> |
||||||
|
<subreportParameter name="REPORT_LOCALE"> |
||||||
|
<subreportParameterExpression><![CDATA[$P{REPORT_LOCALE}]]></subreportParameterExpression> |
||||||
|
</subreportParameter> |
||||||
|
<subreportParameter name="XML_DATA_DOCUMENT"> |
||||||
|
<subreportParameterExpression><![CDATA[$P{XML_DATA_DOCUMENT}]]></subreportParameterExpression> |
||||||
|
</subreportParameter> |
||||||
|
<subreportParameter name="XML_LOCALE"> |
||||||
|
<subreportParameterExpression><![CDATA[Locale.ENGLISH]]></subreportParameterExpression> |
||||||
|
</subreportParameter> |
||||||
|
<subreportParameter name="XML_NUMBER_PATTERN"> |
||||||
|
<subreportParameterExpression><![CDATA["#0.######"]]></subreportParameterExpression> |
||||||
|
</subreportParameter> |
||||||
|
<subreportParameter name="ordnr"> |
||||||
|
<subreportParameterExpression><xsl:text>"</xsl:text><xsl:value-of select="@ordnr"/><xsl:text>"</xsl:text></subreportParameterExpression> |
||||||
|
</subreportParameter> |
||||||
|
<subreportExpression><xsl:text>"</xsl:text><xsl:value-of select="concat($filename,'.jasper')"/><xsl:text>"</xsl:text></subreportExpression> |
||||||
|
</p:subreportPart> |
||||||
|
</part> |
||||||
|
<!-- now create the subreports --> |
||||||
|
<xsl:result-document href="{concat($filename,'.jrxml')}" format="xml" method="xml"> |
||||||
|
<xsl:call-template name="generateJasperReport" > |
||||||
|
<xsl:with-param name="isMainReport" select="'false'" /> |
||||||
|
<xsl:with-param name="ergebniselementOrdnr" select="@ordnr" /> |
||||||
|
<xsl:with-param name="druckbreite" select="$druckbreite" /> |
||||||
|
<xsl:with-param name="std_zeilenhoehe_tablerow" select="$std_zeilenhoehe_tablerow" /> |
||||||
|
</xsl:call-template> |
||||||
|
</xsl:result-document> |
||||||
|
</xsl:for-each> |
||||||
|
</detail> |
||||||
|
</jasperReport> |
||||||
|
</xsl:template> |
||||||
|
<!--Beispiel überlagere das Standard Template: |
||||||
|
<xsl:template name="tableRowStyle"> |
||||||
|
<xsl:param name="flavorTableRowStyle" select="'listAlternatingBg'" /> |
||||||
|
<xsl:param name="ergebniselementOrdnr" select="0" /> |
||||||
|
<xsl:choose> |
||||||
|
<xsl:when test="$ergebniselementOrdnr=0"> |
||||||
|
<style name="TableRowDetail" mode="Opaque" forecolor="#000000" backcolor="#FFFFFF" hTextAlign="Right" vTextAlign="Middle" isBlankWhenNull="true" fontName="Liberation Sans" fontSize="8"> |
||||||
|
<box rightPadding="2"> |
||||||
|
<pen lineColor="#FFFFFF"/> |
||||||
|
</box> |
||||||
|
<paragraph leftIndent="2" rightIndent="1" spacingBefore="0" spacingAfter="0"/> |
||||||
|
<conditionalStyle> |
||||||
|
<conditionExpression><![CDATA[$F{tab_0Deckblatt Kennzahlenbericht Studiengänge}.contains("Ausw") || $F{tab_0Deckblatt Kennzahlenbericht Studiengänge}.contains("Parameter")]]></conditionExpression> |
||||||
|
<style isBold="true"/> |
||||||
|
</conditionalStyle> |
||||||
|
<conditionalStyle> |
||||||
|
<conditionExpression><![CDATA[Boolean.valueOf( $V{PAGE_COUNT} % 2 == 1 )]]></conditionExpression> |
||||||
|
<style mode="Opaque" forecolor="#000000" backcolor="#E3E8EB"/> |
||||||
|
</conditionalStyle> |
||||||
|
</style> |
||||||
|
</xsl:when> |
||||||
|
<xsl:otherwise> |
||||||
|
<xsl:if test="$flavorTableRowStyle='listAlternatingBg'"> |
||||||
|
<style name="TableRowDetail" mode="Opaque" forecolor="#000000" backcolor="#FFFFFF" hTextAlign="Right" vTextAlign="Middle" isBlankWhenNull="true" fontName="{$font}" fontSize="8"> |
||||||
|
<box rightPadding="2"> |
||||||
|
<pen lineColor="#FFFFFF"/> |
||||||
|
</box> |
||||||
|
<paragraph leftIndent="2" rightIndent="1" spacingBefore="0" spacingAfter="0"/> |
||||||
|
<conditionalStyle> |
||||||
|
<conditionExpression><![CDATA[Boolean.valueOf( $V{PAGE_COUNT} % 2 == 1 )]]></conditionExpression> |
||||||
|
<style mode="Opaque" forecolor="#000000" backcolor="#E3E8EB"/> |
||||||
|
</conditionalStyle> |
||||||
|
</style> |
||||||
|
</xsl:if> |
||||||
|
</xsl:otherwise> |
||||||
|
</xsl:choose> |
||||||
|
|
||||||
|
</xsl:template>--> |
||||||
|
</xsl:stylesheet> |
Loading…
Reference in new issue