jasperreports-server-ce/samples/reports/GroovyReport.jrxml

107 lines
4.4 KiB
XML
Executable File

<?xml version="1.0" encoding="UTF-8"?>
<!--
~ Copyright © 2005 - 2018 TIBCO Software Inc.
~ http://www.jaspersoft.com.
~
~ This program is free software: you can redistribute it and/or modify
~ it under the terms of the GNU Affero General Public License as published by
~ the Free Software Foundation, either version 3 of the License, or
~ (at your option) any later version.
~
~ This program is distributed in the hope that it will be useful,
~ but WITHOUT ANY WARRANTY; without even the implied warranty of
~ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
~ GNU Affero General Public License for more details.
~
~ You should have received a copy of the GNU Affero General Public License
~ along with this program. If not, see <https://www.gnu.org/licenses/>.
-->
<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="GroovyReport" language="groovy" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="515" leftMargin="40" rightMargin="40" topMargin="50" bottomMargin="50">
<parameter name="A" class="java.lang.Double">
<defaultValueExpression><![CDATA[3]]></defaultValueExpression>
</parameter>
<parameter name="B" class="java.lang.Double">
<defaultValueExpression><![CDATA[5]]></defaultValueExpression>
</parameter>
<variable name="Chart" class="net.sf.jasperreports.engine.JRRenderable" calculation="System"/>
<title>
<band height="742" splitType="Stretch">
<line>
<reportElement x="0" y="0" width="515" height="1"/>
</line>
<staticText>
<reportElement x="0" y="10" width="515" height="30"/>
<textElement textAlignment="Center">
<font size="22"/>
</textElement>
<text><![CDATA[Groovy Sample]]></text>
</staticText>
<textField hyperlinkType="Reference" hyperlinkTarget="Blank">
<reportElement x="0" y="50" width="515" height="50"/>
<textElement textAlignment="Center">
<font size="12"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["This sample uses Groovy Version 1.0 beta 10\n" + "http://groovy.codehaus.org/"]]></textFieldExpression>
<hyperlinkReferenceExpression><![CDATA["http://groovy.codehaus.org/"]]></hyperlinkReferenceExpression>
</textField>
<textField>
<reportElement x="280" y="150" width="200" height="35"/>
<textElement>
<font size="24"/>
</textElement>
<textFieldExpression class="java.lang.Double"><![CDATA[$P{A}]]></textFieldExpression>
</textField>
<staticText>
<reportElement positionType="Float" x="0" y="150" width="259" height="35"/>
<textElement textAlignment="Right">
<font size="24"/>
</textElement>
<text><![CDATA[A =]]></text>
</staticText>
<staticText>
<reportElement positionType="Float" x="0" y="190" width="259" height="35"/>
<textElement textAlignment="Right">
<font size="24"/>
</textElement>
<text><![CDATA[B =]]></text>
</staticText>
<textField>
<reportElement x="280" y="190" width="200" height="35"/>
<textElement>
<font size="24"/>
</textElement>
<textFieldExpression class="java.lang.Double"><![CDATA[$P{B}]]></textFieldExpression>
</textField>
<staticText>
<reportElement positionType="Float" x="0" y="230" width="259" height="35"/>
<textElement textAlignment="Right">
<font size="24"/>
</textElement>
<text><![CDATA[Java A + B =]]></text>
</staticText>
<textField>
<reportElement x="280" y="230" width="200" height="35" forecolor="#FF0000"/>
<textElement>
<font size="24"/>
</textElement>
<textFieldExpression class="java.lang.Double"><![CDATA[new Double($P{A}.doubleValue() + $P{B}.doubleValue())]]></textFieldExpression>
</textField>
<staticText>
<reportElement positionType="Float" x="0" y="270" width="259" height="35"/>
<textElement textAlignment="Right">
<font size="24"/>
</textElement>
<text><![CDATA[Groovy A + B =]]></text>
</staticText>
<textField>
<reportElement x="280" y="270" width="200" height="35" forecolor="#008000"/>
<textElement>
<font size="24"/>
</textElement>
<textFieldExpression class="java.lang.Double"><![CDATA[$P{A} + $P{B}]]></textFieldExpression>
</textField>
</band>
</title>
</jasperReport>