Skip to content

Instantly share code, notes, and snippets.

@MafaldaLandeiro
Created March 26, 2016 16:20
Show Gist options
  • Select an option

  • Save MafaldaLandeiro/b0655fe9ea88e9f275ae to your computer and use it in GitHub Desktop.

Select an option

Save MafaldaLandeiro/b0655fe9ea88e9f275ae to your computer and use it in GitHub Desktop.
Template report
<?xml version="1.0"?>
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport name="jasper_test">
<!-- Our fields from the Person class. -->
<field name="firstName" class="java.lang.String"/>
<field name="lastName" class="java.lang.String"/>
<field name="age" class="java.lang.Integer"/>
<title>
<band height="50">
<staticText>
<reportElement x="0" y="0" width="180" height="15"/>
<textElement/>
<text><![CDATA[PEOPLE LIST - REPORT]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band/>
</pageHeader>
<columnHeader>
<band height="20">
<staticText>
<reportElement x="50" y="0" width="150" height="20"/>
<textElement>
<font isUnderline="true"/>
</textElement>
<text><![CDATA[FIRSTNAME]]></text>
</staticText>
<staticText>
<reportElement x="200" y="0" width="150" height="20"/>
<textElement>
<font isUnderline="true"/>
</textElement>
<text><![CDATA[LASTNAME]]></text>
</staticText>
<staticText>
<reportElement x="350" y="0" width="150" height="20"/>
<textElement>
<font isUnderline="true"/>
</textElement>
<text><![CDATA[AGE]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20">
<textField>
<reportElement x="50" y="0" width="150" height="15"/>
<textElement/>
<textFieldExpression><![CDATA[$F{firstName}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="200" y="0" width="150" height="15"/>
<textElement/>
<textFieldExpression><![CDATA[$F{lastName}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="350" y="0" width="150" height="15"/>
<textElement/>
<textFieldExpression><![CDATA[$F{age}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band/>
</columnFooter>
<pageFooter>
<band height="15">
<staticText>
<reportElement x="0" y="0" width="40" height="15"/>
<textElement/>
<text><![CDATA[Page:]]></text>
</staticText>
<textField>
<reportElement x="40" y="0" width="100" height="15"/>
<textElement/>
<textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band/>
</summary>
</jasperReport>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment