René Nyffenegger's collection of things on the web | |
René Nyffenegger on Oracle - Most wanted - Feedback
- Follow @renenyffenegger
|
Jasper - Datasources | ||
The same datasource used in page header and detail.
<?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> <![CDATA[ select 'to be displayed in header' hdr, 'to be displayed in detail' det from dual ]]> </queryString> <field name="HDR" class="java.lang.String"/> <field name="DET" class="java.lang.String"/> <pageHeader> <band height='13'> <textField> <reportElement x= "0" y="0" width="200" height="13"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{HDR}]]></textFieldExpression> </textField> </band> </pageHeader> <detail> <band height="13" splitType="Stretch"> <textField> <reportElement x="20" y="0" width="200" height="13"/> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA[$F{DET}]]></textFieldExpression> </textField> </band> </detail> </jasperReport>
See also other Jasper examples.
|