Browse Source

Bugfix PDF Export von Datenbalken #3

userinfo_gueltigkeit
Daniel Quathamer 9 months ago
parent
commit
6d55dcd200
  1. 32
      superx/xml/graphtools.xsl
  2. 7
      superx/xml/pageComponents_html.xsl
  3. 13
      superx/xml/tabelle_fo_pdf.xsl

32
superx/xml/graphtools.xsl

@ -1,6 +1,7 @@ @@ -1,6 +1,7 @@
<?xml version="1.0" encoding="UTF-8" ?>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:svg="http://www.w3.org/2000/svg">
<xsl:template name="graph">
<xsl:param name="graphwidth" select="100" />
<xsl:param name="graphheight" select="20" />
@ -23,10 +24,14 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> @@ -23,10 +24,14 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:otherwise><xsl:value-of select="$feldwert"/></xsl:otherwise>
</xsl:choose>
</xsl:variable>
<xsl:variable name="barColorBg">
<xsl:call-template name="myBarColorBg" />
</xsl:variable>
<xsl:if test="string-length($feldwert) &gt; 0">
<svg width="{$graphwidth}" height="{$graphheight}"><g>
<rect x="0" y="0" width="{$graphwidth}" height="{$graphheight}" fill="#cccccc">
<title><xsl:value-of select="$gesamt"/></title></rect>
<svg:svg width="{concat($graphwidth,'px')}" height="{concat($graphheight,'px')}"><svg:g>
<svg:rect x="0" y="0" width="{concat($graphwidth,'px')}" height="{concat($graphheight,'px')}" fill="{$barColorBg}">
<svg:title><xsl:value-of select="$gesamt"/></svg:title></svg:rect>
<xsl:choose>
@ -89,8 +94,8 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> @@ -89,8 +94,8 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
</xsl:otherwise>
</xsl:choose>
</g>
</svg>
</svg:g>
</svg:svg>
</xsl:if>
</xsl:template>
<xsl:template name="chartBarXSeries">
@ -143,15 +148,20 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform"> @@ -143,15 +148,20 @@ xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
<xsl:value-of select="$maxwidth * ($barValue div $barMaxValue)"/>
</xsl:variable>
<rect class="{$barClass}"
<xsl:variable name="barColorFg">
<xsl:call-template name="myBarColorFg" />
</xsl:variable>
<svg:rect class="{$barClass}"
width="{$barWidth}" height="{$barHeight}"
x="{$x}" y="{$y}"
rx="5" ry="5">
<title><xsl:value-of select="format-number($barLabel,'###.###.###.###.##0,00','German')"/></title></rect>
rx="5" ry="5" fill="{$barColorFg}">
<svg:title><xsl:value-of select="format-number($barLabel,'###.###.###.###.##0,00','German')"/></svg:title></svg:rect>
<xsl:if test="$showLabel='true' and $barWidth &gt; 5 and $barLabel !=''">
<text x="{$x + ($barWidth div 2)}" y="{$barHeight div 2}" class="{$barLabelClass}"
<svg:text x="{$x + ($barWidth div 2)}" y="{$barHeight div 2}" class="{$barLabelClass}"
dominant-baseline="middle" text-anchor="middle">
<xsl:value-of select="format-number($barLabel,'###.###.###.###.##0','German')"/></text>
<xsl:value-of select="format-number($barLabel,'###.###.###.###.##0','German')"/></svg:text>
</xsl:if>
</xsl:template>
</xsl:stylesheet>

7
superx/xml/pageComponents_html.xsl

@ -2200,4 +2200,11 @@ jQuery.ajaxPrefilter( function( s ) { @@ -2200,4 +2200,11 @@ jQuery.ajaxPrefilter( function( s ) {
</div>
</div>
</xsl:template>
<!--graphtools-Layout Templates, können in pageComponents_html_final.xsl überlagert werden-->
<xsl:template name="myBarColorFg" >
<xsl:text>steelblue</xsl:text>
</xsl:template>
<xsl:template name="myBarColorBg" >
<xsl:text>#cccccc</xsl:text>
</xsl:template>
</xsl:stylesheet>

13
superx/xml/tabelle_fo_pdf.xsl

@ -439,6 +439,18 @@ foUserAgent.setBaseURL("file:///"+ getServletConfig().getServletContext().getRea @@ -439,6 +439,18 @@ foUserAgent.setBaseURL("file:///"+ getServletConfig().getServletContext().getRea
line-height="{$font_size_normal}" language="en" hyphenate="true">
<xsl:variable name="checkname"><xsl:value-of select="concat('hidden',f_name,'dp')" /></xsl:variable>
<xsl:choose>
<xsl:when test="starts-with(f_name,'_graph')"> <!-- Balkendiagramm -->
<fo:instream-foreign-object>
<xsl:variable name="feldname"><xsl:value-of select="f_name"/></xsl:variable>
<xsl:call-template name="graph">
<xsl:with-param name="graphwidth" select="../../headers/header[f_name=$feldname]/@width * 12" />
<xsl:with-param name="graphheight" select="20" />
<xsl:with-param name="feldname" select="f_name" />
<xsl:with-param name="feldwert" select="wert" />
</xsl:call-template>
</fo:instream-foreign-object>
</xsl:when>
<xsl:when test="@typ='2' or @typ='8' or @typ='3'"> <!-- DecimalFormat -->
<xsl:attribute name="text-align">end</xsl:attribute>
<xsl:choose> <!--MB wenn es eine versteckte hidden_decimalpl gibt auswerten -->
@ -502,7 +514,6 @@ line-height="{$font_size_normal}" language="en" hyphenate="true"> @@ -502,7 +514,6 @@ line-height="{$font_size_normal}" language="en" hyphenate="true">
</xsl:otherwise>
</xsl:choose>
</fo:block>
</fo:table-cell><xsl:text>
</xsl:text>
</xsl:template>

Loading…
Cancel
Save