René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
Jasper - Report Totals | ||
Print the report total of a letter with a variable within the summary band.
<?xml version="1.0" encoding="UTF-8"?> <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="report name" pageWidth="595" pageHeight="845" columnWidth="595" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0"> <queryString language="SQL"> <![CDATA[select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual union all select 1 val_1 from dual]]> </queryString> <field name="VAL_1" class="java.math.BigDecimal"/> <variable name="sum_val_1" class="java.math.BigDecimal" calculation="Sum"> <variableExpression><![CDATA[$F{VAL_1}]]></variableExpression> </variable> <detail> <band height="20" splitType="Stretch"> <textField> <reportElement x="0" y="0" width="555" height="20"/> <textElement/> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{VAL_1}]]></textFieldExpression> </textField> </band> </detail> <columnFooter> <band height="50"> <staticText> <reportElement x="42" y="14" width="100" height="20"/> <textElement/> <text><![CDATA[Column Footer]]></text> </staticText> </band> </columnFooter> <pageFooter> <band height="50"> <staticText> <reportElement x="370" y="15" width="100" height="20"/> <textElement/> <text><![CDATA[Page Footer]]></text> </staticText> </band> </pageFooter> <summary> <band height="20" splitType="Immediate"> <textField> <reportElement x="142" y="0" width="100" height="20"/> <textElement/> <textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{sum_val_1}]]></textFieldExpression> </textField> </band> </summary> </jasperReport>
See also other Jasper examples.
|