How to combine repited values in one border in Jasper Report? - jasper-reports

I created Jasper report which doesn't print repited values in the first column "Route" (field name groupDescription)
It works ok, but the problem is - it doesn't combine borders of those repited values.
I tried add first column to separate group and change the borders, but it didn't help.
How can I combine borders as well, so in result report can look like this?
Here is my jrxml file
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.19.1.final using JasperReports Library version 6.19.1-867c00bf88cd4d784d404379d6c05e1b419e8a4c -->
<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="gpsmisseddataonroute" pageWidth="705" pageHeight="842" columnWidth="685" leftMargin="10" rightMargin="10" topMargin="10" bottomMargin="10" isFloatColumnFooter="true" isIgnorePagination="true" uuid="3ebc481d-07fa-407e-8647-51d27f87c7f2">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<property name="net.sf.jasperreports.export.csv.field.delimiter" value=";"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<style name="Default" isDefault="true" pdfFontName="/fonts/ARIALN.TTF" pdfEncoding="Identity-H"/>
<parameter name="carrier" class="java.lang.String"/>
<parameter name="date" class="java.lang.String"/>
<parameter name="time" class="java.lang.String"/>
<parameter name="header" class="java.lang.String"/>
<parameter name="groupDescription" class="java.lang.String"/>
<parameter name="ordinal" class="java.lang.String"/>
<parameter name="licensePlate" class="java.lang.String"/>
<parameter name="lastEventTime" class="java.lang.String"/>
<parameter name="notes" class="java.lang.String"/>
<field name="groupDescription" class="java.lang.String"/>
<field name="ordinal" class="java.lang.String"/>
<field name="licensePlate" class="java.lang.String"/>
<field name="lastEventTime" class="java.lang.String"/>
<field name="notes" class="java.lang.String"/>
<title>
<band height="90">
<textField>
<reportElement x="65" y="20" width="284" height="20" uuid="1587c4cd-9174-4d1f-aa3e-665507834e77"/>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{carrier}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="65" y="40" width="284" height="20" uuid="1bb50a29-26f6-4389-b448-de69a4167c80"/>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{date}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="65" y="60" width="284" height="20" uuid="94b925f3-e71a-4094-a5f3-ac8d61fa2a62"/>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{time}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="0" width="685" height="20" uuid="49caef1a-d5a7-4174-a84f-1fb62d89d4c1"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{header}]]></textFieldExpression>
</textField>
</band>
</title>
<columnHeader>
<band height="40" splitType="Stretch">
<staticText>
<reportElement mode="Opaque" x="245" y="0" width="29" height="35" backcolor="#999999" uuid="3ee4cb1f-ec9b-448f-b734-2427fd2764f8"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0"/>
<bottomPen lineWidth="2.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[#]]></text>
</staticText>
<textField>
<reportElement stretchType="RelativeToTallestObject" mode="Opaque" x="274" y="0" width="46" height="35" backcolor="#999999" uuid="b7816a55-171c-40ea-bbea-fa6685309ba8"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0"/>
<bottomPen lineWidth="2.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{ordinal}]]></textFieldExpression>
</textField>
<textField>
<reportElement stretchType="RelativeToTallestObject" mode="Opaque" x="320" y="0" width="130" height="35" backcolor="#999999" uuid="a6a976e9-6466-45b0-8f35-b32545efd711"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0"/>
<bottomPen lineWidth="2.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="11" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{licensePlate}]]></textFieldExpression>
</textField>
<textField>
<reportElement stretchType="RelativeToTallestObject" mode="Opaque" x="450" y="0" width="112" height="35" backcolor="#999999" uuid="2190c925-a2e1-48f3-983b-9a4f7911de64"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0"/>
<bottomPen lineWidth="2.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{lastEventTime}]]></textFieldExpression>
</textField>
<textField>
<reportElement stretchType="RelativeToTallestObject" mode="Opaque" x="562" y="0" width="123" height="35" backcolor="#999999" uuid="b4b3fe7d-8b2a-4d41-9544-d8f0beb5ae63"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0"/>
<bottomPen lineWidth="2.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{notes}]]></textFieldExpression>
</textField>
<textField>
<reportElement stretchType="RelativeToTallestObject" mode="Opaque" x="0" y="0" width="245" height="35" backcolor="#999999" uuid="ada908a0-7ade-40e6-8c70-3d842fb45e05"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0"/>
<bottomPen lineWidth="2.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$P{groupDescription}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="29" splitType="Stretch">
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" x="245" y="0" width="29" height="24" uuid="a14ad59f-e9d5-4a26-8dae-efcb9e95484d"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12" pdfEncoding="Identity-H"/>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$V{COLUMN_COUNT}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" x="274" y="0" width="46" height="24" uuid="ca3caa3a-ef01-4ecd-8582-f499261ec6e0"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12"/>
<paragraph rightIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{ordinal}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" x="320" y="0" width="130" height="24" uuid="6c0e24a2-f97c-43d0-a055-2f4d19e34225"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12"/>
<paragraph rightIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{licensePlate}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" x="450" y="0" width="112" height="24" uuid="1e0d4140-5702-4deb-bfe0-ef2bf50d9d92"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0"/>
<leftPen lineWidth="2.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{lastEventTime}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" x="562" y="0" width="123" height="24" uuid="2953ab4e-507b-4f07-8ded-ff480873d557"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12"/>
</textElement>
<textFieldExpression><![CDATA[$F{notes}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true">
<reportElement stretchType="RelativeToTallestObject" isPrintRepeatedValues="false" x="0" y="0" width="245" height="24" isPrintInFirstWholeBand="true" isPrintWhenDetailOverflows="true" uuid="58eb7f6a-1f5c-47fb-b24a-275d92968a1d"/>
<box>
<pen lineWidth="1.0"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="DejaVu Sans" size="12"/>
<paragraph leftIndent="5"/>
</textElement>
<textFieldExpression><![CDATA[$F{groupDescription}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>

Related

In Jaspersoft studio 6, How to calculate total for a particular row in crosstab

I am using in Jaspersoft studio 6 and currently working with crosstab. I am a newbie in crosstab and have just started using it. I have created a jrxml file with crosstab(with lots of trial and error, I might add) as follows
<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.2.0.final using JasperReports Library version 6.2.0 -->
<!-- 2022-06-29T20:43:31 -->
<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="MAH_Attendance_subjasper" pageWidth="1500" pageHeight="650" orientation="Landscape" columnWidth="1460" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0e151e12-e64e-4195-aba5-d1747d8a798d">
<property name="com.jaspersoft.studio.data.sql.tables" value=""/>
<property name="com.jaspersoft.studio.unit." value="pixel"/>
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="MAH HR DB"/>
<style name="Crosstab_CH" mode="Opaque"/>
<style name="Crosstab_CG" mode="Opaque" backcolor="#BFE1FF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Crosstab_CT" mode="Opaque" backcolor="#005FB3">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="Crosstab_CD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
<topPen lineWidth="0.5" lineColor="#000000"/>
<leftPen lineWidth="0.5" lineColor="#000000"/>
<bottomPen lineWidth="0.5" lineColor="#000000"/>
<rightPen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="CS_Sunday" backcolor="#FFFFFF">
<conditionalStyle>
<conditionExpression><![CDATA[$V{DayOfWeeek}=="SUN"]]></conditionExpression>
<style forecolor="#058FFF" backcolor="#737373"/>
</conditionalStyle>
</style>
<queryString language="SQL">
<![CDATA[SELECT
emp.emp_number AS empNumber,
CONCAT_WS(" ",emp.first_name,emp.middle_name,emp.last_name)AS emp_name,
att.punch_in_time AS PunchInTime,
att.punch_out_time AS PunchOutTime,
TIME_FORMAT(TIMEDIFF(CONCAT(DATE(att.punch_out_date)," ",(att.punch_out_time)),CONCAT(DATE(att.punch_in_date)," ",(att.punch_in_time))),'%H:%i') AS Total,
att.shift_in_time AS Rosterin,
att.shift_out_time AS Rosterout,
TIME_FORMAT(TIMEDIFF(att.punch_out_time,att.shift_out_time),'%H:%i') AS Extra,
IFNULL(DATE(att.punch_in_date),'') AS punch_in_date,
DAYOFMONTH(att.punch_in_date) AS DayOfMonthh,
CASE
WHEN DAYOFWEEK(att.punch_in_date)=1 THEN 'SUN'
WHEN DAYOFWEEK(att.punch_in_date)=2 THEN 'MON'
WHEN DAYOFWEEK(att.punch_in_date)=3 THEN 'TUE'
WHEN DAYOFWEEK(att.punch_in_date)=4 THEN 'WED'
WHEN DAYOFWEEK(att.punch_in_date)=5 THEN 'THU'
WHEN DAYOFWEEK(att.punch_in_date)=6 THEN 'FRI'
WHEN DAYOFWEEK(att.punch_in_date)=7 THEN 'SAT'
END AS DayOfWeeek
FROM
hr_employees emp,
hr_pay_periods hpr,
hr_setup SETUP1,
hr_setup SETUP2,
hr_transfers tr,
hr_emp_attendance att
LEFT JOIN hr_leaves lv ON (att.employee_id=lv.employee_id AND att.punch_in_date BETWEEN lv.start_date AND lv.end_date)
LEFT JOIN hr_leave_types lt ON(lt.id = lv.leave_type_id AND lt.leave_division_code='LOP')
WHERE
emp.id =att.employee_id
AND emp.id =tr.employee_id
AND emp.emp_number=1
AND tr.active_yn='1'
AND DATE_FORMAT(tr.start_date,'%Y-%m-%d')<=DATE_FORMAT(hpr.end_date,'%Y-%m-%d')
AND (DATE_FORMAT(tr.end_date,'%Y-%m-%d')>=DATE_FORMAT(hpr.start_date,'%Y-%m-%d') OR tr.end_date IS NULL)
AND DATE_FORMAT(att.punch_in_date,'%Y-%m-%d') >=DATE_FORMAT(hpr.start_date,'%Y-%m-%d')
AND DATE_FORMAT(att.punch_in_date,'%Y-%m-%d') <=DATE_FORMAT(hpr.end_date,'%Y-%m-%d')
AND DATE_FORMAT(att.punch_in_date,'%Y-%m-%d') >=DATE_FORMAT(tr.start_date,'%Y-%m-%d')
AND (DATE_FORMAT(att.punch_in_date,'%Y-%m-%d')<=DATE_FORMAT(tr.end_date,'%Y-%m-%d') OR tr.end_date IS NULL)
AND SETUP1.setup_key="HR_EMPLOYEE_NUM_PREFIX"
AND SETUP2.setup_key="HR_EMPLOYEE_NUM_SUFFIX"
AND att.punch_in_date BETWEEN '2022-03-01' AND '2022-03-31'
ORDER BY emp.emp_number,punch_in_date]]>
</queryString>
<field name="empNumber" class="java.lang.String"/>
<field name="emp_name" class="java.lang.String"/>
<field name="PunchInTime" class="java.sql.Time"/>
<field name="PunchOutTime" class="java.sql.Time"/>
<field name="Total" class="java.sql.Time"/>
<field name="Rosterin" class="java.sql.Time"/>
<field name="Rosterout" class="java.sql.Time"/>
<field name="Extra" class="java.sql.Time"/>
<field name="punch_in_date" class="java.lang.Object"/>
<field name="DayOfMonthh" class="java.lang.Integer"/>
<field name="DayOfWeeek" class="java.lang.String"/>
<variable name="Variable_1" class="java.lang.String"/>
<variable name="Variable_2" class="java.lang.String"/>
<variable name="Variable_3" class="java.lang.String"/>
<variable name="Variable_4" class="java.lang.String"/>
<variable name="Variable_5" class="java.lang.String"/>
<variable name="Variable_6" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<summary>
<band height="161" splitType="Stretch">
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<crosstab ignoreWidth="false">
<reportElement x="0" y="0" width="1420" height="160" uuid="b9ff42cf-4d41-4581-93ba-9a6a0d737d58">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="com.jaspersoft.studio.crosstab.style.header" value="Crosstab_CH"/>
<property name="com.jaspersoft.studio.crosstab.style.group" value="Crosstab_CG"/>
<property name="com.jaspersoft.studio.crosstab.style.total" value="Crosstab_CT"/>
<property name="com.jaspersoft.studio.crosstab.style.detail" value="Crosstab_CD"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
</box>
<crosstabHeaderCell>
<cellContents>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField-1" mode="Transparent" x="0" y="0" width="60" height="20" forecolor="#000000" backcolor="#FFFFFF" uuid="5cb94b6f-b1c1-4751-8cc9-1023a08817ba"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA["Date"]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField-1" style="CS_Sunday" mode="Transparent" x="0" y="20" width="60" height="20" forecolor="#000000" backcolor="#FFFFFF" uuid="acfafcf8-f527-474d-8627-a7132a747c48"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA["Day"]]></textFieldExpression>
</textField>
</cellContents>
</crosstabHeaderCell>
<rowGroup name="empNumber" width="60" mergeHeaderCells="false">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{empNumber}]]></bucketExpression>
</bucket>
<crosstabRowHeader>
<cellContents mode="Opaque" style="Crosstab_CH">
<property name="com.jaspersoft.studio.layout" value="com.jaspersoft.studio.editor.layout.VerticalRowLayout"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField-1" mode="Transparent" x="0" y="0" width="60" height="20" forecolor="#000000" backcolor="#FFFFFF" uuid="46855b10-d1a0-4975-b4a9-0c4e63fc8004"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA["In"]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField-1" mode="Transparent" x="0" y="20" width="60" height="20" forecolor="#000000" backcolor="#FFFFFF" uuid="61085207-f106-4ae5-a7be-a40dd4f9e33b"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA["Out"]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField-1" mode="Transparent" x="0" y="40" width="60" height="20" forecolor="#000000" backcolor="#FFFFFF" uuid="577e468c-f2a4-4e42-99f1-287363338475"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA["Total"]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField-1" mode="Transparent" x="0" y="60" width="60" height="20" forecolor="#000000" backcolor="#FFFFFF" uuid="d89eaa0d-ddd9-4352-9fbb-46572e082ed5"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA["Roster In"]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField-1" mode="Transparent" x="0" y="80" width="60" height="20" forecolor="#000000" backcolor="#FFFFFF" uuid="1e60e74b-1df1-4a2b-8ba4-e639b7c95a47"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA["Roster Out"]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="false">
<reportElement key="textField-1" mode="Transparent" x="0" y="100" width="60" height="20" forecolor="#000000" backcolor="#FFFFFF" uuid="c9cb35b1-69d9-4075-8a74-2b6e3a5d4916">
<property name="com.jaspersoft.studio.unit.height" value="pixel"/>
</reportElement>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Arial" size="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false"/>
<paragraph lineSpacing="Single"/>
</textElement>
<textFieldExpression><![CDATA["Extra"]]></textFieldExpression>
</textField>
</cellContents>
</crosstabRowHeader>
<crosstabTotalRowHeader>
<cellContents mode="Opaque" style="Crosstab_CT">
<staticText>
<reportElement x="0" y="0" width="0" height="0" forecolor="#FFFFFF" uuid="6b02ffab-4f0f-4c9b-ab2c-46ca85f651a3"/>
<text><![CDATA[Total empNumber]]></text>
</staticText>
</cellContents>
</crosstabTotalRowHeader>
</rowGroup>
<columnGroup name="DayOfMonthh" height="20" totalPosition="End">
<bucket class="java.lang.Integer">
<bucketExpression><![CDATA[$F{DayOfMonthh}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents mode="Opaque" style="Crosstab_CH">
<textField>
<reportElement style="CS_Sunday" x="0" y="0" width="40" height="20" uuid="718bc55d-1ed4-460e-80dd-af8703ba0c90">
<property name="com.jaspersoft.studio.unit.width" value="pixel"/>
</reportElement>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{DayOfMonthh}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents mode="Opaque" style="Crosstab_CT">
<staticText>
<reportElement x="0" y="0" width="0" height="0" forecolor="#FFFFFF" uuid="07e7807e-6981-4dab-b854-c5c8bf274b97"/>
<text><![CDATA[Total DayOfMonthh]]></text>
</staticText>
</cellContents>
</crosstabTotalColumnHeader>
</columnGroup>
<columnGroup name="DayOfWeeek" height="20">
<bucket class="java.lang.String">
<bucketExpression><![CDATA[$F{DayOfWeeek}]]></bucketExpression>
</bucket>
<crosstabColumnHeader>
<cellContents mode="Opaque" style="CS_Sunday">
<textField isBlankWhenNull="true">
<reportElement style="CS_Sunday" x="0" y="0" width="40" height="20" uuid="23a405f5-a6c2-4f4a-be59-d9d5a9e16f3f"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{DayOfWeeek}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabColumnHeader>
<crosstabTotalColumnHeader>
<cellContents mode="Opaque" style="Crosstab_CG">
<staticText>
<reportElement x="0" y="0" width="40" height="20" uuid="edcbd158-c0e7-4268-aff9-0e302e553b25"/>
<text><![CDATA[Total DayOfWeeek]]></text>
</staticText>
</cellContents>
</crosstabTotalColumnHeader>
</columnGroup>
<measure name="PunchInTime_MEASURE" class="java.sql.Time" calculation="Count">
<measureExpression><![CDATA[$F{PunchInTime}]]></measureExpression>
</measure>
<measure name="PunchOutTime_MEASURE" class="java.sql.Time" calculation="Count">
<measureExpression><![CDATA[$F{PunchOutTime}]]></measureExpression>
</measure>
<measure name="Total_MEASURE" class="java.sql.Time">
<measureExpression><![CDATA[$F{Total}]]></measureExpression>
</measure>
<measure name="Rosterin_MEASURE" class="java.sql.Time" calculation="Count">
<measureExpression><![CDATA[$F{Rosterin}]]></measureExpression>
</measure>
<measure name="Rosterout_MEASURE" class="java.sql.Time" calculation="Count">
<measureExpression><![CDATA[$F{Rosterout}]]></measureExpression>
</measure>
<measure name="Extra_MEASURE" class="java.sql.Time" calculation="Count">
<measureExpression><![CDATA[$F{Extra}]]></measureExpression>
</measure>
<measure name="Measure1" class="java.sql.Time" calculation="Sum">
<measureExpression><![CDATA[$F{Extra}]]></measureExpression>
</measure>
<crosstabCell width="40" height="120">
<cellContents mode="Opaque" style="Crosstab_CD">
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<textField pattern="HH:mm" isBlankWhenNull="true">
<reportElement style="CS_Sunday" x="0" y="0" width="40" height="20" uuid="4b55089e-2a5c-4ce4-beea-3bb57815c61b"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{PunchInTime_MEASURE}]]></textFieldExpression>
</textField>
<textField pattern="HH:mm" isBlankWhenNull="true">
<reportElement style="CS_Sunday" x="0" y="20" width="40" height="20" uuid="bd55a1cc-0094-482b-b3ff-35197f893d52"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{PunchOutTime_MEASURE}]]></textFieldExpression>
</textField>
<textField pattern="HH:mm" isBlankWhenNull="true">
<reportElement style="CS_Sunday" x="0" y="40" width="40" height="20" uuid="6a7f1df0-e5df-42f1-8ca7-df0d2baa4ee5"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{Total_MEASURE}]]></textFieldExpression>
</textField>
<textField pattern="HH:mm" isBlankWhenNull="true">
<reportElement style="CS_Sunday" x="0" y="60" width="40" height="20" uuid="84b3700f-d3e9-4401-be4e-db1b6c6ea42e"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{Rosterin_MEASURE}]]></textFieldExpression>
</textField>
<textField pattern="HH:mm" isBlankWhenNull="true">
<reportElement style="CS_Sunday" x="0" y="80" width="40" height="20" uuid="d118ce37-b5d5-4082-8244-31941463812b"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{Rosterout_MEASURE}]]></textFieldExpression>
</textField>
<textField pattern="HH:mm" isBlankWhenNull="true">
<reportElement style="CS_Sunday" x="0" y="100" width="40" height="20" uuid="f79896f4-39d6-4de6-8c6f-1ec067bd503e"/>
<box>
<pen lineWidth="1.0" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle"/>
<textFieldExpression><![CDATA[$V{Extra_MEASURE}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell height="120" columnTotalGroup="DayOfMonthh">
<cellContents>
<textField pattern="HH:mm">
<reportElement x="0" y="0" width="40" height="120" uuid="3b6da2ce-2fe5-40b4-bbfb-2fed9b9d3217"/>
<textFieldExpression><![CDATA[$V{Measure1}]]></textFieldExpression>
</textField>
</cellContents>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="empNumber" columnTotalGroup="DayOfMonthh">
<cellContents/>
</crosstabCell>
<crosstabCell height="120" columnTotalGroup="DayOfWeeek">
<cellContents/>
</crosstabCell>
<crosstabCell width="60" height="20" rowTotalGroup="empNumber" columnTotalGroup="DayOfWeeek">
<cellContents/>
</crosstabCell>
</crosstab>
</band>
</summary>
</jasperReport>
Following is the output
https://ibb.co/x75CB7Y
I have 2 requirements:
I would like to show the sum for two rows - Total and Extra.
For the Sunday columns cells, I would like to have gray color as the background.
For the second item, I know that we can use conditional style. I have tried using it but I could not get it to work. I would appriciate any help.
Edit:
I have managed to add a new measure for the sum. But as the field is of the type java.sql.Time, I am unable to get the sum of all rows. It just gives the last value of the row in the sum measure field. I have updated the jrxml file and the output above. Is there any workaround for getting the sum of time values?

How to create a jasper table and textfields inside the list component with XML datasource?

I am trying to generate report using Jasper iReport Designer 5.6.0, where there is a list with table and some textfields. The generated report should look like this:
To do this, I'm using the following XML file as datasource:
<report>
<subreport>
<nameOfState>USA</nameOfState>
<persons>
<person>
<dateOfBirth>1989-02-01T00:00:00.000Z</dateOfBirth>
<fullName>Skyler White</fullName>
<address>Albuquerque 87107</address>
</person>
<person>
<dateOfBirth>1962-02-01T00:00:00.000Z</dateOfBirth>
<fullName>Jesse Pinkman</fullName>
<address>Santa Fé 28</address>
<companies>
<company>
<nameOfCompany>Company 124</nameOfCompany>
<addressOfCompany>Santa Fé 158</addressOfCompany>
</company>
</companies>
</person>
</persons>
</subreport>
<subreport>
<nameOfState>Germany</nameOfState>
<person>
<dateOfBirth>1970-02-01T00:00:00.000Z</dateOfBirth>
<fullName>Hank Schrader</fullName>
<address>El Paso 17</address>
<companies>
<company>
<nameOfCompany>El Paso Company</nameOfCompany>
<addressOfCompany>El Paso 28</addressOfCompany>
</company>
<company>
<nameOfCompany>COMPANY EPC</nameOfCompany>
<addressOfCompany>Santa Fé 18</addressOfCompany>
</company>
</companies>
</person>
</persons>
</subreport>
</report>
And jrxml template:
<?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="report1_subreport1" pageWidth="756" pageHeight="140" whenNoDataType="BlankPage" columnWidth="756" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenResourceMissingType="Error" isIgnorePagination="true" uuid="0a5fd60a-c7ea-46b7-a1e6-484cdedee54a">
<property name="ireport.zoom" value="1.7715610000000022"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="table 3">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 3_TH" mode="Opaque">
<box>
<pen lineWidth="0.0" lineColor="#000000"/>
</box>
</style>
<style name="table 3_CH" mode="Opaque" backcolor="#FFD0BF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 3_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="PersonsDataset" uuid="cf4c2515-8d53-4c2a-a6ca-d33257aa8e74">
<queryString language="xPath">
<![CDATA[/subreport/persons/person]]>
</queryString>
<field name="dateOfBirth" class="java.lang.String">
<fieldDescription><![CDATA[dateOfBirth]]></fieldDescription>
</field>
<field name="fullName" class="java.lang.String">
<fieldDescription><![CDATA[fullName]]></fieldDescription>
</field>
<field name="address" class="java.lang.String">
<fieldDescription><![CDATA[address]]></fieldDescription>
</field>
</subDataset>
<subDataset name="CompanyDataset" uuid="80440d3f-8de3-4fe7-8d02-62734435d23d">
<queryString language="xPath">
<![CDATA[/company]]>
</queryString>
<field name="nameOfCompany" class="java.lang.String">
<fieldDescription><![CDATA[child::text()]]></fieldDescription>
</field>
<field name="addressOfCompany" class="java.lang.String">
<fieldDescription><![CDATA[child::text()]]></fieldDescription>
</field>
</subDataset>
<queryString language="xPath">
<![CDATA[/subreport/persons/person]]>
</queryString>
<field name="nameOfState" class="java.lang.String">
<fieldDescription><![CDATA[nameOfState]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="140" splitType="Stretch">
<componentElement>
<reportElement x="0" y="36" width="753" height="104" uuid="e417d0a1-9945-42e9-b12b-8bf0573c93ba"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="PersonsDataset" uuid="c0d23173-9df2-452c-9d97-78dee6f766ef">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/subreport/persons/person")]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="104" width="753">
<staticText>
<reportElement mode="Opaque" x="11" y="11" width="100" height="13" backcolor="#C0C0C0" uuid="21b820ed-d7eb-4c92-a1c7-8b60880bb3b6"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[Full name]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="11" y="24" width="100" height="13" backcolor="#C0C0C0" uuid="1b637cc8-c654-4734-9ee8-debc404931a2"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[Address:]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="11" y="37" width="100" height="13" backcolor="#C0C0C0" uuid="08dc2de1-652a-4cd5-b572-344dbadb3b91"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[Date of birth:]]></text>
</staticText>
<textField>
<reportElement x="112" y="11" width="239" height="13" uuid="d18bd33c-028a-4cae-8748-e0f5b12faff5"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression><![CDATA[$F{fullName}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="112" y="24" width="239" height="13" uuid="242e9491-3e9b-450c-bbb8-bf7565e67fa6"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression><![CDATA[$F{address}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="112" y="37" width="239" height="13" uuid="efe7b9b3-7573-411a-bada-620939ada8dc"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression><![CDATA[$F{dateOfBirth}]]></textFieldExpression>
</textField>
<componentElement>
<reportElement key="NajdenaOsobaTable1" style="table 3" stretchType="RelativeToBandHeight" mode="Transparent" x="96" y="66" width="645" height="25" isPrintWhenDetailOverflows="true" uuid="99480409-009b-4f75-b435-ad99403ddb56"/>
<jr:table whenNoDataType="AllSectionsNoDetail">
<datasetRun subDataset="CompanyDataset" uuid="cc9ac018-67f1-4011-995c-d95cd30b8ce3">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/subreport/person/companies/company")]]></dataSourceExpression>
</datasetRun>
<jr:column width="125" uuid="db854a2c-d49e-46ae-a57b-38be7cd8e7f8">
<jr:tableHeader style="table 3_TH" height="17" rowSpan="1">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="125" height="17" backcolor="#C0C0C0" uuid="8ef76d08-af87-4e3b-9436-2f9863275e50"/>
<box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1">
<pen lineWidth="0.75"/>
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8" isBold="false" pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[Name of Company]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell style="table 3_TD" height="16" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="125" height="16" isPrintWhenDetailOverflows="true" uuid="d1bcdf70-4494-4552-9c84-2c1acf29d5fa"/>
<box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1">
<pen lineWidth="0.75"/>
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8" pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression><![CDATA[$F{nameOfCompany}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="160" uuid="db2c69c2-67ce-4de0-b8fc-4f24b969127f">
<jr:tableHeader style="table 3_TH" height="17" rowSpan="1">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="160" height="17" backcolor="#C0C0C0" uuid="80f738f8-58c1-4959-b441-b1a3424e6bd6"/>
<box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1">
<pen lineWidth="0.75"/>
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8" pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[Address of Company]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell style="table 3_TD" height="16" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="160" height="16" isPrintWhenDetailOverflows="true" uuid="6351ecdf-eb49-4738-bb51-dee451c5761b"/>
<box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1">
<pen lineWidth="0.75"/>
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8" pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression><![CDATA[$F{addressOfCompany}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</jr:listContents>
</jr:list>
</componentElement>
<textField>
<reportElement x="12" y="10" width="100" height="20" uuid="a8753122-9817-4500-81f2-99d703df00b8"/>
<textFieldExpression><![CDATA[$F{nameOfState}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
And this is what I'm getting as resulting report (grey line is a pagebreak):
This is image what the report inspector looks like in my iReport Designer
So I am only using the detail band in this subreport.
EDIT:
List is necesarry because the data are from multiple countries, and this jrxml represent subreport which is nested in the main report.
This is all about defining your subDataset (with related fields) and XPath query in subDataSource correctly. A general indication would be query down to node, then generate subDatasource stepping back one node.
The solution in this case is to first query for the detail band (main XPath query of report)
<queryString language="XPath">
<![CDATA[/report/subreport]]>
</queryString>
This way in detail band you access you first fields nameOfState.
Then
In detail band while we are "running" on node subreport we add the jr:list component the subDataSource will be /subreport/persons/person to access the fields dateOfBirth, fullName etc.
<datasetRun subDataset="PersonsDataset" uuid="c0d23173-9df2-452c-9d97-78dee6f766ef">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/subreport/persons/person")]]></dataSourceExpression>
</datasetRun>
and then we are at the node person so for the jr:table your query is /person/companies/company
<datasetRun subDataset="CompanyDataset" uuid="cc9ac018-67f1-4011-995c-d95cd30b8ce3">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/person/companies/company")]]></dataSourceExpression>
</datasetRun>
For subDataset and field definition see the full example, it's more straight forward, since you are creating the datasource (subDatasource) the XPath query is actually not need for the subDataset (it's only needed on main query), you only need to have correct field declaration with same names as xml tags.
Full jrxml
<?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="report1_subreport1" pageWidth="756" pageHeight="140" whenNoDataType="BlankPage" columnWidth="756" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" whenResourceMissingType="Error" isIgnorePagination="true" uuid="0a5fd60a-c7ea-46b7-a1e6-484cdedee54a">
<style name="table 3">
<box>
<pen lineWidth="1.0" lineColor="#000000"/>
</box>
</style>
<style name="table 3_TH" mode="Opaque">
<box>
<pen lineWidth="0.0" lineColor="#000000"/>
</box>
</style>
<style name="table 3_CH" mode="Opaque" backcolor="#FFD0BF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<style name="table 3_TD" mode="Opaque" backcolor="#FFFFFF">
<box>
<pen lineWidth="0.5" lineColor="#000000"/>
</box>
</style>
<subDataset name="PersonsDataset" uuid="cf4c2515-8d53-4c2a-a6ca-d33257aa8e74">
<field name="dateOfBirth" class="java.lang.String">
<fieldDescription><![CDATA[dateOfBirth]]></fieldDescription>
</field>
<field name="fullName" class="java.lang.String">
<fieldDescription><![CDATA[fullName]]></fieldDescription>
</field>
<field name="address" class="java.lang.String">
<fieldDescription><![CDATA[address]]></fieldDescription>
</field>
</subDataset>
<subDataset name="CompanyDataset" uuid="80440d3f-8de3-4fe7-8d02-62734435d23d">
<field name="nameOfCompany" class="java.lang.String">
<fieldDescription><![CDATA[nameOfCompany]]></fieldDescription>
</field>
<field name="addressOfCompany" class="java.lang.String">
<fieldDescription><![CDATA[addressOfCompany]]></fieldDescription>
</field>
</subDataset>
<queryString language="xPath">
<![CDATA[/report/subreport]]>
</queryString>
<field name="nameOfState" class="java.lang.String">
<property name="net.sf.jasperreports.xpath.field.expression" value="nameOfState"/>
<fieldDescription><![CDATA[nameOfState]]></fieldDescription>
</field>
<background>
<band splitType="Stretch"/>
</background>
<detail>
<band height="140" splitType="Stretch">
<componentElement>
<reportElement x="0" y="36" width="753" height="104" uuid="e417d0a1-9945-42e9-b12b-8bf0573c93ba"/>
<jr:list xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Vertical">
<datasetRun subDataset="PersonsDataset" uuid="c0d23173-9df2-452c-9d97-78dee6f766ef">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/subreport/persons/person")]]></dataSourceExpression>
</datasetRun>
<jr:listContents height="104" width="753">
<staticText>
<reportElement mode="Opaque" x="11" y="11" width="100" height="13" backcolor="#C0C0C0" uuid="21b820ed-d7eb-4c92-a1c7-8b60880bb3b6"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[Full name]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="11" y="24" width="100" height="13" backcolor="#C0C0C0" uuid="1b637cc8-c654-4734-9ee8-debc404931a2"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[Address:]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="11" y="37" width="100" height="13" backcolor="#C0C0C0" uuid="08dc2de1-652a-4cd5-b572-344dbadb3b91"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[Date of birth:]]></text>
</staticText>
<textField>
<reportElement x="112" y="11" width="239" height="13" uuid="d18bd33c-028a-4cae-8748-e0f5b12faff5"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression><![CDATA[$F{fullName}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="112" y="24" width="239" height="13" uuid="242e9491-3e9b-450c-bbb8-bf7565e67fa6"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression><![CDATA[$F{address}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="112" y="37" width="239" height="13" uuid="efe7b9b3-7573-411a-bada-620939ada8dc"/>
<box leftPadding="2">
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement verticalAlignment="Middle">
<font size="8" pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression><![CDATA[$F{dateOfBirth}]]></textFieldExpression>
</textField>
<componentElement>
<reportElement key="NajdenaOsobaTable1" style="table 3" stretchType="RelativeToBandHeight" mode="Transparent" x="96" y="66" width="645" height="25" isPrintWhenDetailOverflows="true" uuid="99480409-009b-4f75-b435-ad99403ddb56"/>
<jr:table whenNoDataType="AllSectionsNoDetail">
<datasetRun subDataset="CompanyDataset" uuid="cc9ac018-67f1-4011-995c-d95cd30b8ce3">
<dataSourceExpression><![CDATA[((net.sf.jasperreports.engine.data.JRXmlDataSource)$P{REPORT_DATA_SOURCE}).subDataSource("/person/companies/company")]]></dataSourceExpression>
</datasetRun>
<jr:column width="125" uuid="db854a2c-d49e-46ae-a57b-38be7cd8e7f8">
<jr:tableHeader style="table 3_TH" height="17" rowSpan="1">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="125" height="17" backcolor="#C0C0C0" uuid="8ef76d08-af87-4e3b-9436-2f9863275e50"/>
<box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1">
<pen lineWidth="0.75"/>
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8" isBold="false" pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[Name of Company]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell style="table 3_TD" height="16" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="125" height="16" isPrintWhenDetailOverflows="true" uuid="d1bcdf70-4494-4552-9c84-2c1acf29d5fa"/>
<box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1">
<pen lineWidth="0.75"/>
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8" pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression><![CDATA[$F{nameOfCompany}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
<jr:column width="160" uuid="db2c69c2-67ce-4de0-b8fc-4f24b969127f">
<jr:tableHeader style="table 3_TH" height="17" rowSpan="1">
<staticText>
<reportElement mode="Opaque" x="0" y="0" width="160" height="17" backcolor="#C0C0C0" uuid="80f738f8-58c1-4959-b441-b1a3424e6bd6"/>
<box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1">
<pen lineWidth="0.75"/>
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8" pdfEncoding="Cp1250"/>
</textElement>
<text><![CDATA[Address of Company]]></text>
</staticText>
</jr:tableHeader>
<jr:detailCell style="table 3_TD" height="16" rowSpan="1">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="160" height="16" isPrintWhenDetailOverflows="true" uuid="6351ecdf-eb49-4738-bb51-dee451c5761b"/>
<box topPadding="1" leftPadding="1" bottomPadding="1" rightPadding="1">
<pen lineWidth="0.75"/>
<topPen lineWidth="0.75"/>
<leftPen lineWidth="0.75"/>
<bottomPen lineWidth="0.75"/>
<rightPen lineWidth="0.75"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8" pdfEncoding="Cp1250"/>
</textElement>
<textFieldExpression><![CDATA[$F{addressOfCompany}]]></textFieldExpression>
</textField>
</jr:detailCell>
</jr:column>
</jr:table>
</componentElement>
</jr:listContents>
</jr:list>
</componentElement>
<textField>
<reportElement x="12" y="10" width="100" height="20" uuid="a8753122-9817-4500-81f2-99d703df00b8"/>
<textFieldExpression><![CDATA[$F{nameOfState}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
Result

Jasper report export to RTF not working correctly

I am using jrxml to export to RTF format.
When number of columns are 12 it is working fine otherwise if we increase number of columns view seems distorted.
When I exported with 10 columns it looks perfectly fine.
I am new to this could anyone help me in this case.
jrxml template used:
<?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="PSDefaultPointAndClick" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20">
<property name="ireport.scriptlethandling" value="0"/>
<property name="ireport.encoding" value="UTF-8"/>
<property name="ireport.zoom" value="1.4641000000000006"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<import value="net.sf.jasperreports.engine.*"/>
<import value="java.util.*"/>
<import value="net.sf.jasperreports.engine.data.*"/>
<parameter name="system.REPORT_NAME" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["Default Report"]]></defaultValueExpression>
</parameter>
<parameter name="config.SUPPORTED_FORMATS" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["HTML,PDF,EXCEL,EXCEL_2007,RTF,CSV,POWERPOINT_2007"]]></defaultValueExpression>
</parameter>
<parameter name="config.FOR_INTERNAL_USE" class="java.lang.String" isForPrompting="false"/>
<parameter name="system.REPORT_FOOTER" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["Copyright (c) 2007,"]]></defaultValueExpression>
</parameter>
<parameter name="config.DATASOURCE" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["PointAndClick"]]></defaultValueExpression>
</parameter>
<parameter name="system.RUN_BY_AND_ON_INFO" class="java.lang.String" isForPrompting="false"/>
<parameter name="system.GENERATION_DATE" class="java.lang.String" isForPrompting="false"/>
<parameter name="system.USER_NAME" class="java.lang.String" isForPrompting="false"/>
<parameter name="system.PAGE" class="java.lang.String" isForPrompting="false"/>
<parameter name="system.EXPORT_FORMAT" class="java.lang.String" isForPrompting="false"/>
<field name="work_id" class="java.lang.String"/>
<field name="name" class="java.lang.String"/>
<field name="owner" class="java.lang.String"/>
<field name="owner_id" class="java.lang.String"/>
<field name="status_current" class="java.lang.String"/>
<field name="active_gate" class="java.lang.String"/>
<field name="active_gate_id" class="java.lang.String"/>
<group name="level1">
<groupExpression><![CDATA[]]></groupExpression>
<groupHeader>
<band height="16" splitType="Prevent">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-12" stretchType="RelativeToBandHeight" mode="Opaque" x="54" y="0" width="341" height="16" backcolor="#EBEBEB"/>
<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<leftPen lineWidth="0.0"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<rightPen lineWidth="0.0"/>
</box>
<textElement verticalAlignment="Bottom">
<font fontName="Arial" isBold="true" pdfFontName="Helvetica-Bold" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Group Level 1 "]]></textFieldExpression>
</textField>
</band>
</groupHeader>
<groupFooter>
<band height="20" splitType="Prevent">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-22" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="395" height="16" backcolor="#FFFFFF"/>
<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<leftPen lineWidth="0.0"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<rightPen lineWidth="0.0"/>
</box>
<textElement>
<font fontName="Arial" isBold="true" isItalic="false" pdfFontName="Helvetica-Bold" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Summary Level 1 "]]></textFieldExpression>
</textField>
</band>
</groupFooter>
</group>
<group name="level2">
<groupExpression><![CDATA[]]></groupExpression>
<groupHeader>
<band height="16" splitType="Prevent">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-13" stretchType="RelativeToBandHeight" mode="Opaque" x="99" y="0" width="296" height="16" backcolor="#EBEBEB"/>
<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<leftPen lineWidth="0.0"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<rightPen lineWidth="0.0"/>
</box>
<textElement verticalAlignment="Bottom">
<font fontName="Arial" isBold="true" pdfFontName="Helvetica-Bold" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Group Level 2 "]]></textFieldExpression>
</textField>
</band>
</groupHeader>
<groupFooter>
<band height="20" splitType="Prevent">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-21" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="395" height="16" backcolor="#FFFFFF"/>
<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<leftPen lineWidth="0.0"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<rightPen lineWidth="0.0"/>
</box>
<textElement>
<font fontName="Arial" isBold="true" pdfFontName="Helvetica-Bold" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Summary Level 2 "]]></textFieldExpression>
</textField>
</band>
</groupFooter>
</group>
<group name="level3">
<groupExpression><![CDATA[]]></groupExpression>
<groupHeader>
<band height="16" splitType="Prevent">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-14" stretchType="RelativeToBandHeight" mode="Opaque" x="158" y="0" width="237" height="16" backcolor="#EBEBEB"/>
<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<leftPen lineWidth="0.0"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<rightPen lineWidth="0.0"/>
</box>
<textElement verticalAlignment="Bottom">
<font fontName="Arial" isBold="true" pdfFontName="Helvetica-Bold" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Group Level 3 "]]></textFieldExpression>
</textField>
</band>
</groupHeader>
<groupFooter>
<band height="20" splitType="Prevent">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-20" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="395" height="16"/>
<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<leftPen lineWidth="0.0"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<rightPen lineWidth="0.0"/>
</box>
<textElement>
<font fontName="Arial" isBold="true" pdfFontName="Helvetica-Bold" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Summary Level 3 "]]></textFieldExpression>
</textField>
</band>
</groupFooter>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band splitType="Stretch"/>
</title>
<pageHeader>
<band splitType="Stretch"/>
</pageHeader>
<columnHeader>
<band height="16" splitType="Prevent">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-4" stretchType="RelativeToTallestObject" mode="Opaque" x="0" y="0" width="395" height="16" backcolor="#E7EFF7"/>
<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<leftPen lineWidth="1.0" lineColor="#FFFFFF"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<rightPen lineWidth="1.0" lineColor="#FFFFFF"/>
</box>
<textElement verticalAlignment="Bottom">
<font fontName="Arial" isBold="true" pdfFontName="Helvetica-Bold" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["ColumnTitle"]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="16" splitType="Prevent">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-11" stretchType="RelativeToBandHeight" mode="Opaque" x="235" y="0" width="160" height="16"/>
<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2"/>
<textElement>
<font fontName="Arial" isBold="false" pdfFontName="Helvetica" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Even_Row"]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-16" stretchType="RelativeToBandHeight" mode="Opaque" x="395" y="0" width="140" height="16" backcolor="#FCFAF6"/>
<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2"/>
<textElement>
<font fontName="Arial" isBold="false" pdfFontName="Helvetica" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Odd_Row"]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band height="20" splitType="Prevent">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-17" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="395" height="16"/>
<box topPadding="1" leftPadding="2" bottomPadding="1" rightPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<leftPen lineWidth="0.0"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<rightPen lineWidth="0.0"/>
</box>
<textElement>
<font fontName="Arial" isBold="true" pdfFontName="Helvetica-Bold" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Column Summary"]]></textFieldExpression>
</textField>
</band>
</columnFooter>
<pageFooter>
<band height="42" splitType="Prevent">
<textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement key="textField-26" mode="Opaque" x="0" y="6" width="58" height="36" backcolor="#F5F5F5"/>
<box topPadding="3" bottomPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial" pdfFontName="Helvetica" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{system.PAGE} + " " + $V{PAGE_NUMBER} + " /"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report" isBlankWhenNull="false">
<reportElement key="textField-27" mode="Opaque" x="58" y="6" width="59" height="36" backcolor="#F5F5F5"/>
<box topPadding="3" bottomPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="Arial" pdfFontName="Helvetica" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="false">
<reportElement key="textField-28" mode="Opaque" x="117" y="6" width="418" height="36" backcolor="#F5F5F5"/>
<box topPadding="3" bottomPadding="2" rightPadding="9">
<pen lineWidth="0.0"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial" pdfFontName="Helvetica" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{system.REPORT_FOOTER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<lastPageFooter>
<band height="38" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="false">
<reportElement key="textField-23" mode="Opaque" x="0" y="2" width="58" height="36" backcolor="#F5F5F5"/>
<box topPadding="3" bottomPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial" pdfFontName="Helvetica" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{system.PAGE} + " " + $V{PAGE_NUMBER} + " /"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report" isBlankWhenNull="false">
<reportElement key="textField-24" mode="Opaque" x="58" y="2" width="59" height="36" backcolor="#F5F5F5"/>
<box topPadding="3" bottomPadding="2">
<pen lineWidth="0.0"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="Arial" pdfFontName="Helvetica" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="false">
<reportElement key="textField-25" mode="Opaque" x="117" y="2" width="418" height="36" backcolor="#F5F5F5"/>
<box topPadding="3" bottomPadding="2" rightPadding="9">
<pen lineWidth="0.0"/>
<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
<bottomPen lineWidth="0.0" lineColor="#000000"/>
<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial" pdfFontName="Helvetica" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{system.REPORT_FOOTER}]]></textFieldExpression>
</textField>
</band>
</lastPageFooter>
<summary>
<band height="16" splitType="Stretch">
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement key="textField-18" stretchType="RelativeToBandHeight" mode="Opaque" x="0" y="0" width="535" height="16"/>
<box>
<topPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
<bottomPen lineWidth="1.0" lineStyle="Solid" lineColor="#FFFFFF"/>
</box>
<textElement>
<font fontName="Arial" isBold="true" pdfFontName="Helvetica-Bold" size="9"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA["Root Summary"]]></textFieldExpression>
</textField>
</band>
</summary>
</jasperReport>
JRXML file:
https://www.dropbox.com/s/l866uv4z7sccf2c/12columns.jrxml?dl=0
You cannot create an RTF document with a page size larger than 22 inch.
Your report template has a width of 23.11 inches.
The best explanation I could find is here.

net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Verdana' is not available to the JVM. But I'm not using this font

while deploying this jasper file in a linux server. I've got the error :
net.sf.jasperreports.engine.util.JRFontNotFoundException: Font 'Verdana' is not available to the JVM.
But I'm not using this Font. I'm using "SansSerif" which is handled by linux.
PS. The Jasper file was first created by iReport 3.0 then I switched to iReport 5.1. But I recompiled it, and it worked perfectly in the localhost..
Any help please ?
<?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="EditerRecapAppro" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="842" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="fad38eb7-04c4-46b7-92d1-e002d57c48ee">
<property name="ireport.scriptlethandling" value="0"/>
<property name="ireport.encoding" value="UTF-8"/>
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<import value="net.sf.jasperreports.engine.*"/>
<import value="java.util.*"/>
<import value="net.sf.jasperreports.engine.data.*"/>
<parameter name="pWhere" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["1=1"]]></defaultValueExpression>
</parameter>
<parameter name="pOrder" class="java.lang.String" isForPrompting="false">
<defaultValueExpression><![CDATA["1"]]></defaultValueExpression>
</parameter>
<parameter name="pCodeMagasin" class="java.lang.String" isForPrompting="false"/>
<parameter name="pCodeDemandeur" class="java.lang.String" isForPrompting="false"/>
<parameter name="pNumeroBS" class="java.lang.String" isForPrompting="false"/>
<parameter name="pDatePC" class="java.lang.String" isForPrompting="false"/>
<queryString>
<![CDATA[SELECT
GLO_AS_APPRO_ENTETE.NUM_AUT_MVT AS NUM_APP,
GLO_AS_APPRO_ENTETE.DATE_PEC AS DAT_APP,
GLO_AS_APPRO_ENTETE.COD_SER AS CODE_SERVICE,
(SELECT LIB_SERVICE_FR FROM GLO_AS_SERVICE WHERE GLO_AS_SERVICE.COD_SER = GLO_AS_APPRO_ENTETE.COD_SER AND GLO_AS_SERVICE.COD_ETAB = GLO_AS_APPRO_ENTETE.COD_ETAB) AS LIB_SERVICE,
GLO_AS_APPRO_LIGNE.NUM_LIGNE AS NUM_LIG,
GLO_AS_APPRO_LIGNE.COD_ARTC AS CODE_ARTICLE,
(SELECT DES_ARTC_FR FROM GLO_AS_ARTICLE WHERE GLO_AS_ARTICLE.COD_ARTC = GLO_AS_APPRO_LIGNE.COD_ARTC) AS LIB_ARTICLE,
GLO_AS_APPRO_LIGNE.COD_UNT AS UNIT,
GLO_AS_APPRO_LIGNE.QTE_APP,
(SELECT COD_MAG || ' - ' || LIB_MAG_FR FROM GLO_AS_MAGASINS WHERE GLO_AS_MAGASINS.COD_MAG = GLO_AS_APPRO_ENTETE.COD_MAG AND GLO_AS_MAGASINS.COD_ETAB = GLO_AS_APPRO_ENTETE.COD_ETAB) AS MAGASIN
FROM
GLO_AS_APPRO_ENTETE join GLO_AS_APPRO_LIGNE ON
GLO_AS_APPRO_ENTETE.NUM_AUT_MVT = GLO_AS_APPRO_LIGNE.NUM_AUT_MVT AND
GLO_AS_APPRO_ENTETE.COD_ETAB = GLO_AS_APPRO_LIGNE.COD_ETAB AND
GLO_AS_APPRO_ENTETE.EXERCICE = GLO_AS_APPRO_LIGNE.EXERCICE
WHERE $P!{pWhere} AND GLO_AS_APPRO_ENTETE.VALID='O' AND GLO_AS_APPRO_ENTETE.STAT_APP = 'E'
ORDER BY $P!{pOrder}, GLO_AS_APPRO_LIGNE.NUM_LIGNE]]>
</queryString>
<field name="NUM_APP" class="java.math.BigDecimal"/>
<field name="DAT_APP" class="java.sql.Timestamp"/>
<field name="CODE_SERVICE" class="java.lang.String"/>
<field name="LIB_SERVICE" class="java.lang.String"/>
<field name="NUM_LIG" class="java.math.BigDecimal"/>
<field name="CODE_ARTICLE" class="java.lang.String"/>
<field name="LIB_ARTICLE" class="java.lang.String"/>
<field name="UNIT" class="java.lang.String"/>
<field name="QTE_APP" class="java.math.BigDecimal"/>
<field name="MAGASIN" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band splitType="Stretch"/>
</title>
<pageHeader>
<band height="53" splitType="Stretch">
<staticText>
<reportElement uuid="e8affdf7-8f50-4194-ae2f-655ea31a165b" key="staticText-18" x="320" y="3" width="70" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[new Boolean($P{pCodeMagasin} != null)]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="7"/>
</textElement>
<text><![CDATA[Code magasin :]]></text>
</staticText>
<textField isBlankWhenNull="false">
<reportElement uuid="6a783e2e-c5b8-4231-bfff-c79d4c241421" key="textField-18" x="390" y="3" width="130" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[new Boolean($P{pCodeMagasin} != null)]]></printWhenExpression>
</reportElement>
<textElement>
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$P{pCodeMagasin}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="e25887f6-51c0-435e-b949-a4b9340742f5" key="staticText-19" x="320" y="15" width="70" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[new Boolean($P{pCodeDemandeur} != null)]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="7"/>
</textElement>
<text><![CDATA[Code demandeur :]]></text>
</staticText>
<staticText>
<reportElement uuid="9425cadc-19ca-4f53-8f30-0000d1614f23" key="staticText-20" x="320" y="27" width="70" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[new Boolean($P{pNumeroBS} != null)]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="7"/>
</textElement>
<text><![CDATA[Numéro bon de sortie :]]></text>
</staticText>
<textField isBlankWhenNull="false">
<reportElement uuid="38de488c-a435-4a09-ba0c-35a238e8bbdd" key="textField-19" x="390" y="15" width="130" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[new Boolean($P{pCodeDemandeur} != null)]]></printWhenExpression>
</reportElement>
<textElement>
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$P{pCodeDemandeur}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="false">
<reportElement uuid="841888af-5a52-444f-b1f8-c5a66d66d1a0" key="textField-20" x="390" y="27" width="130" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[new Boolean($P{pNumeroBS} != null)]]></printWhenExpression>
</reportElement>
<textElement>
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$P{pNumeroBS}]]></textFieldExpression>
</textField>
<staticText>
<reportElement uuid="7199ea7e-c7c6-470a-b2d6-bab27507e03c" key="staticText-21" x="270" y="39" width="120" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[new Boolean($P{pDatePC} != null)]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="7"/>
</textElement>
<text><![CDATA[Date de prise en charge :]]></text>
</staticText>
<textField isBlankWhenNull="false">
<reportElement uuid="a73a3da3-4438-4a29-806b-b08a343425cf" key="textField-21" x="390" y="39" width="130" height="12" isRemoveLineWhenBlank="true">
<printWhenExpression><![CDATA[new Boolean($P{pDatePC} != null)]]></printWhenExpression>
</reportElement>
<textElement>
<font fontName="SansSerif" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$P{pDatePC}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="60" splitType="Stretch">
<staticText>
<reportElement uuid="00f4ca75-4054-4189-b47b-0b5f8eb44b47" key="staticText-1" mode="Opaque" x="126" y="30" width="295" height="15" backcolor="#CCCCCC"/>
<box>
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[Service demandeur]]></text>
</staticText>
<staticText>
<reportElement uuid="6f8f52a5-00d6-4b28-ac8d-8b89ad67a30b" key="staticText-2" mode="Opaque" x="1" y="45" width="45" height="15" backcolor="#CCCCCC"/>
<box>
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[N°]]></text>
</staticText>
<staticText>
<reportElement uuid="c4937b21-c87b-4dd8-a3bd-daa607cfadb8" key="staticText-3" mode="Opaque" x="46" y="45" width="50" height="15" backcolor="#CCCCCC"/>
<box>
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="8"/>
</textElement>
<text><![CDATA[Date]]></text>
</staticText>
<staticText>
<reportElement uuid="e4997b00-e680-4dea-b9a0-31caf76812f7" key="staticText-6" mode="Opaque" x="421" y="30" width="50" height="30" backcolor="#CCCCCC"/>
<box>
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[Type]]></text>
</staticText>
<staticText>
<reportElement uuid="6d7d880b-3fe8-4a11-8626-dbd396075e04" key="staticText-7" mode="Opaque" x="171" y="45" width="250" height="15" backcolor="#CCCCCC"/>
<box leftPadding="3">
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[Designation]]></text>
</staticText>
<staticText>
<reportElement uuid="d60cbb17-00a2-4c53-8893-5787adc72132" key="staticText-8" mode="Opaque" x="126" y="45" width="45" height="15" backcolor="#CCCCCC"/>
<box>
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[Code]]></text>
</staticText>
<staticText>
<reportElement uuid="97b495be-69a1-4b86-8be0-0d52ae3af3f4" key="staticText-10" mode="Opaque" x="1" y="30" width="125" height="15" backcolor="#CCCCCC"/>
<box>
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[Demande]]></text>
</staticText>
<staticText>
<reportElement uuid="e42335e4-aaa9-4dfa-bc2c-d41a2b33373d" key="staticText-11" mode="Opaque" x="96" y="45" width="30" height="15" backcolor="#CCCCCC"/>
<box>
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[N°]]></text>
</staticText>
<staticText>
<reportElement uuid="3a929df7-3200-4d55-bcb5-336ef11f93f9" key="staticText-12" mode="Opaque" x="471" y="30" width="310" height="15" backcolor="#CCCCCC"/>
<box>
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[Article]]></text>
</staticText>
<staticText>
<reportElement uuid="03743f97-7dfc-42d9-ad5f-a8c5775f2364" key="staticText-13" mode="Opaque" x="471" y="45" width="50" height="15" backcolor="#CCCCCC"/>
<box>
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[Code]]></text>
</staticText>
<staticText>
<reportElement uuid="07426d9a-1d21-41f1-b2c6-f8d61256500d" key="staticText-14" mode="Opaque" x="521" y="45" width="230" height="15" backcolor="#CCCCCC"/>
<box leftPadding="3">
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[Designation]]></text>
</staticText>
<staticText>
<reportElement uuid="5d0ccba5-a561-4e96-b152-7a7a780fd006" key="staticText-15" mode="Opaque" x="781" y="30" width="40" height="30" backcolor="#CCCCCC"/>
<box>
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="9"/>
</textElement>
<text><![CDATA[Quantité]]></text>
</staticText>
<staticText>
<reportElement uuid="80412bed-dc27-4c1b-ab1d-3fa3f24b0595" key="staticText-16" mode="Opaque" x="751" y="45" width="30" height="15" backcolor="#CCCCCC"/>
<box>
<pen lineWidth="0.0" lineStyle="Solid"/>
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[Un.]]></text>
</staticText>
<staticText>
<reportElement uuid="a793d6a7-e73e-4442-84fa-49e9f3685a32" key="staticText-17" mode="Opaque" x="1" y="10" width="70" height="15" backcolor="#FFFFFF"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<text><![CDATA[Magasin :]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement uuid="4c307279-d5ee-46d7-9528-7ef8facf3fcf" key="textField-17" x="71" y="10" width="250" height="15"/>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{MAGASIN}]]></textFieldExpression>
</textField>
</band>
</columnHeader>
<detail>
<band height="15" splitType="Stretch">
<textField pattern="" isBlankWhenNull="true">
<reportElement uuid="9dd3dae1-3ec0-47cb-bf83-86c3d102c184" key="textField-3" x="1" y="0" width="45" height="15"/>
<box rightPadding="3">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{NUM_APP}]]></textFieldExpression>
</textField>
<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
<reportElement uuid="99e93e13-78c9-4eeb-a5ae-91139d51a000" key="textField-4" x="46" y="0" width="50" height="15"/>
<box leftPadding="3">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{DAT_APP}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="044fae08-595e-416c-a3a0-028f0c61b2c5" key="textField-8" x="421" y="0" width="50" height="15"/>
<box leftPadding="3">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<textFieldExpression><![CDATA[]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="a3ffca82-df87-42ff-bb67-d2fc17843c53" key="textField-10" x="171" y="0" width="250" height="15"/>
<box leftPadding="3">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{LIB_SERVICE}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement uuid="94744acd-192d-400a-aa23-a6d33bcbc21d" key="textField-11" x="126" y="0" width="45" height="15"/>
<box leftPadding="3">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="SansSerif" size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{CODE_SERVICE}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="6b81b174-2cc0-4708-9737-ed16b1d5fe93" key="textField-12" x="96" y="0" width="30" height="15"/>
<box rightPadding="3">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{NUM_LIG}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement uuid="71bb1b34-5b82-4029-a85d-38e23162caa0" key="textField-13" x="471" y="0" width="50" height="15"/>
<box leftPadding="3">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="SansSerif" size="9"/>
</textElement>
<textFieldExpression><![CDATA[$F{CODE_ARTICLE}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="0b1611b3-09b1-468e-8c45-4eab692c886e" key="textField-14" x="521" y="0" width="230" height="15"/>
<box leftPadding="3">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{LIB_ARTICLE}]]></textFieldExpression>
</textField>
<textField pattern="#,##0" isBlankWhenNull="true">
<reportElement uuid="d776b9ac-6182-49e1-a0fc-7c0172c4063f" key="textField-15" x="781" y="0" width="40" height="15"/>
<box rightPadding="3">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{QTE_APP}]]></textFieldExpression>
</textField>
<textField pattern="" isBlankWhenNull="true">
<reportElement uuid="2d9e05f4-cb39-4b3b-b1dd-22be9acab6f9" key="textField-16" x="751" y="0" width="30" height="15"/>
<box leftPadding="3">
<topPen lineWidth="0.5" lineStyle="Solid"/>
<leftPen lineWidth="0.5" lineStyle="Solid"/>
<bottomPen lineWidth="0.5" lineStyle="Solid"/>
<rightPen lineWidth="0.5" lineStyle="Solid"/>
</box>
<textElement textAlignment="Left" verticalAlignment="Middle">
<font fontName="SansSerif" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{UNIT}]]></textFieldExpression>
</textField>
</band>
</detail>
<columnFooter>
<band splitType="Stretch"/>
</columnFooter>
<pageFooter>
<band splitType="Stretch"/>
</pageFooter>
<summary>
<band splitType="Stretch"/>
</summary>
</jasperReport>

How to create watermark in the background band in iReport

I am trying to create a watermark with a text in a report. For e.g. have a text like this is a good report printed horizontally repeatedly at the background of a report. I know this can be done in the background band but don't know how.
UPDATE
Your solution worked. I want to implement this in another way. I want to print the same text repeatedly at the background. Let's say i want to print the text welcome to a new year. I will want it to print this way
welcome to a new year welcome to a new year welcome to a new year welcome to a new year
welcome to a new year welcome to a new year welcome to a new year welcome to a new year
welcome to a new year welcome to a new year welcome to a new year welcome to a new year
welcome to a new year welcome to a new year welcome to a new year welcome to a new year
welcome to a new year welcome to a new year welcome to a new year welcome to a new year
...
All these will be at the background. Can i achieve something like this without manually creating the text fields to fill the page.
Yes, you are right. You can use Background band for printing watermark text (or picture).
You should set the height for this band - I think it is better to set height of this band the same as the report's height.
For example, for A4 format I have set the 802 pixels for Background's band height. The formula for calculating this number was: the Report's height (842 pixels for A4 format) - the Left Margin's width (20 in my case) - the Right Margin's width (20 in my case).
After setting size for the Background band you can put image or staticText (textField) elements to this (Background) band.
You can rotate the text of staticText (textField) element with help of rotation attribute. The available values of this attribites are:
None (no rotation - 0 degrees),
Left (rotate 270 degrees),
Right (rotate 90 degrees),
UpsideDown (rotate 180 degrees).
In the working sample I've used styles for setting the rotation attribute for textField and for one element I've set value for this attribute directly to the textField element:
<?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="watermark_sample" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="bc290dd1-903c-4740-8484-16a2ebe872d2">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<style name="Rotated180" mode="Opaque" forecolor="#FF33CC" hAlign="Center" vAlign="Middle" rotation="UpsideDown" fontName="Curlz MT" fontSize="40"/>
<style name="Rotated270" mode="Opaque" forecolor="#FF33CC" hAlign="Center" vAlign="Middle" rotation="Left" fontName="Curlz MT" fontSize="40"/>
<style name="Rotated90" mode="Opaque" forecolor="#FF33CC" hAlign="Center" vAlign="Middle" rotation="Right" fontName="Curlz MT" fontSize="40"/>
<style name="NotRotated" mode="Opaque" forecolor="#FF33CC" hAlign="Center" vAlign="Middle" rotation="None" fontName="Curlz MT" fontSize="40"/>
<queryString>
<![CDATA[SELECT ID, NAME, COST FROM PRODUCT ORDER BY NAME]]>
</queryString>
<field name="ID" class="java.lang.Integer"/>
<field name="NAME" class="java.lang.String"/>
<field name="COST" class="java.math.BigDecimal"/>
<background>
<band height="802" splitType="Stretch">
<image hAlign="Center">
<reportElement uuid="42c96db8-4afd-4834-ba69-6b211df0c42f" style="Rotated180" mode="Opaque" x="118" y="372" width="318" height="58"/>
<imageExpression><![CDATA["D:\\java\\jasper_reports\\happy_new_year_h.png"]]></imageExpression>
</image>
<staticText>
<reportElement uuid="d7401e33-f1b3-49ca-85d1-2923d82508f6" style="NotRotated" x="106" y="22" width="342" height="63"/>
<textElement/>
<text><![CDATA[Happy New Year!]]></text>
</staticText>
<staticText>
<reportElement uuid="d7401e33-f1b3-49ca-85d1-2923d82508f6" style="Rotated270" x="24" y="236" width="93" height="330"/>
<textElement/>
<text><![CDATA[Happy New Year!]]></text>
</staticText>
<staticText>
<reportElement uuid="d7401e33-f1b3-49ca-85d1-2923d82508f6" style="Rotated90" x="445" y="236" width="93" height="330"/>
<textElement/>
<text><![CDATA[Happy New Year!]]></text>
</staticText>
<staticText>
<reportElement uuid="d7401e33-f1b3-49ca-85d1-2923d82508f6" style="Rotated180" x="106" y="702" width="342" height="63"/>
<textElement/>
<text><![CDATA[Happy New Year!]]></text>
</staticText>
<staticText>
<reportElement uuid="3bdd5d67-94f0-457f-8477-b1d0438d7bc9" mode="Opaque" x="79" y="85" width="428" height="139" forecolor="#9999FF"/>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="Right">
<font fontName="Edwardian Script ITC" size="40" isItalic="true"/>
</textElement>
<text><![CDATA[Happy New Year!]]></text>
</staticText>
</band>
</background>
<title>
<band height="79" splitType="Stretch">
<staticText>
<reportElement uuid="6d708618-09e4-433d-ab48-bb9cbd0b832b" x="92" y="29" width="370" height="20"/>
<textElement>
<font size="14" isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Sample of report with watermark]]></text>
</staticText>
</band>
</title>
<columnHeader>
<band height="20" splitType="Stretch">
<staticText>
<reportElement uuid="414160e2-41c4-4326-8ec8-ff7c230ac2c3" mode="Opaque" x="0" y="0" width="100" height="20" forecolor="#000000" backcolor="#3399FF"/>
<box leftPadding="10" rightPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Id]]></text>
</staticText>
<staticText>
<reportElement uuid="414160e2-41c4-4326-8ec8-ff7c230ac2c3" mode="Opaque" x="200" y="0" width="100" height="20" forecolor="#000000" backcolor="#3399FF"/>
<box leftPadding="10" rightPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Cost]]></text>
</staticText>
<staticText>
<reportElement uuid="414160e2-41c4-4326-8ec8-ff7c230ac2c3" mode="Opaque" x="100" y="0" width="100" height="20" forecolor="#000000" backcolor="#3399FF"/>
<box leftPadding="10" rightPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Name]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<textField>
<reportElement uuid="5715c691-0b39-4530-9009-3b7179bb06f5" x="0" y="0" width="100" height="20"/>
<box leftPadding="10" rightPadding="10">
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="5715c691-0b39-4530-9009-3b7179bb06f5" x="100" y="0" width="100" height="20"/>
<box leftPadding="10">
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement/>
<textFieldExpression><![CDATA[$F{NAME}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="5715c691-0b39-4530-9009-3b7179bb06f5" x="200" y="0" width="100" height="20"/>
<box leftPadding="10" rightPadding="10">
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{COST}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
The image element does not support the rotation attribute, but you can create any image you want manually.
Note: in this sample I've used mode="Opaque" for textField and image elements.
The result will be (via iReport preview function):
For solving your case (several texts as watermark) I've put several textField elements to the Background band. The report's template is:
<?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="watermark_sample" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="bc290dd1-903c-4740-8484-16a2ebe872d2">
<property name="ireport.zoom" value="1.0"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="68"/>
<queryString>
<![CDATA[SELECT ID, NAME, COST FROM PRODUCT ORDER BY NAME]]>
</queryString>
<field name="ID" class="java.lang.Integer"/>
<field name="NAME" class="java.lang.String"/>
<field name="COST" class="java.math.BigDecimal"/>
<background>
<band height="802" splitType="Stretch">
<staticText>
<reportElement uuid="3bdd5d67-94f0-457f-8477-b1d0438d7bc9" mode="Transparent" x="63" y="112" width="428" height="56" forecolor="#808080"/>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Serif" size="40" isItalic="true"/>
</textElement>
<text><![CDATA[this is a good report]]></text>
</staticText>
<staticText>
<reportElement uuid="3bdd5d67-94f0-457f-8477-b1d0438d7bc9" mode="Transparent" x="63" y="272" width="428" height="56" forecolor="#808080"/>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Serif" size="40" isItalic="true"/>
</textElement>
<text><![CDATA[this is a good report]]></text>
</staticText>
<staticText>
<reportElement uuid="3bdd5d67-94f0-457f-8477-b1d0438d7bc9" mode="Transparent" x="63" y="432" width="428" height="56" forecolor="#808080"/>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Serif" size="40" isItalic="true"/>
</textElement>
<text><![CDATA[this is a good report]]></text>
</staticText>
<staticText>
<reportElement uuid="3bdd5d67-94f0-457f-8477-b1d0438d7bc9" mode="Transparent" x="63" y="594" width="428" height="56" forecolor="#808080"/>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None">
<font fontName="Serif" size="40" isItalic="true"/>
</textElement>
<text><![CDATA[this is a good report]]></text>
</staticText>
</band>
</background>
<title>
<band height="79" splitType="Stretch">
<staticText>
<reportElement uuid="6d708618-09e4-433d-ab48-bb9cbd0b832b" x="92" y="29" width="370" height="20"/>
<textElement>
<font size="14" isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Sample of report with watermark]]></text>
</staticText>
</band>
</title>
<columnHeader>
<band height="20" splitType="Stretch">
<staticText>
<reportElement uuid="414160e2-41c4-4326-8ec8-ff7c230ac2c3" mode="Opaque" x="0" y="0" width="100" height="20" forecolor="#000000" backcolor="#3399FF"/>
<box leftPadding="10" rightPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Id]]></text>
</staticText>
<staticText>
<reportElement uuid="414160e2-41c4-4326-8ec8-ff7c230ac2c3" mode="Opaque" x="200" y="0" width="100" height="20" forecolor="#000000" backcolor="#3399FF"/>
<box leftPadding="10" rightPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Cost]]></text>
</staticText>
<staticText>
<reportElement uuid="414160e2-41c4-4326-8ec8-ff7c230ac2c3" mode="Opaque" x="100" y="0" width="100" height="20" forecolor="#000000" backcolor="#3399FF"/>
<box leftPadding="10" rightPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Name]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<textField>
<reportElement uuid="5715c691-0b39-4530-9009-3b7179bb06f5" x="0" y="0" width="100" height="20"/>
<box leftPadding="10" rightPadding="10">
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="5715c691-0b39-4530-9009-3b7179bb06f5" x="100" y="0" width="100" height="20"/>
<box leftPadding="10">
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement/>
<textFieldExpression><![CDATA[$F{NAME}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="5715c691-0b39-4530-9009-3b7179bb06f5" x="200" y="0" width="100" height="20"/>
<box leftPadding="10" rightPadding="10">
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{COST}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
Note: in this sample I've used mode="Transparent" for textField elements.
The report's design (in iReport):
The result will be (via iReport preview function):
You can find more information in Watermark across the page in JasperReports post if you want to set custom rotation angle.
UPDATE: You can solve your second issue, for example, with help of StringUtils.repeat(java.lang.String, int) method from Commons Lang API.
You can add import instruction (<import value="org.apache.commons.lang3.StringUtils"/> in my sample) to your report's template and use the expression like this:
<textFieldExpression><![CDATA[StringUtils.repeat("Welcome to a New Year! ", $P{numberOfRepeats})]]></textFieldExpression>
The jrxml file:
<?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="watermark_sample" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="bc290dd1-903c-4740-8484-16a2ebe872d2">
<import value="org.apache.commons.lang3.StringUtils"/>
<parameter name="numberOfRepeats" class="java.lang.Integer" isForPrompting="false">
<defaultValueExpression><![CDATA[10]]></defaultValueExpression>
</parameter>
<queryString>
<![CDATA[SELECT ID, NAME, COST FROM PRODUCT ORDER BY NAME]]>
</queryString>
<field name="ID" class="java.lang.Integer"/>
<field name="NAME" class="java.lang.String"/>
<field name="COST" class="java.math.BigDecimal"/>
<background>
<band height="802" splitType="Stretch">
<textField isStretchWithOverflow="true">
<reportElement uuid="26290245-c5cf-4f28-b637-c5b0253910a5" mode="Transparent" x="21" y="112" width="470" height="56" forecolor="#808080"/>
<textElement textAlignment="Center" verticalAlignment="Middle" rotation="None" markup="none">
<font fontName="Serif" size="20" isItalic="true"/>
</textElement>
<textFieldExpression><![CDATA[StringUtils.repeat("Welcome to a New Year! ", $P{numberOfRepeats})]]></textFieldExpression>
</textField>
</band>
</background>
<title>
<band height="79" splitType="Stretch">
<staticText>
<reportElement uuid="6d708618-09e4-433d-ab48-bb9cbd0b832b" x="92" y="29" width="370" height="20"/>
<textElement>
<font size="14" isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Sample of report with watermark]]></text>
</staticText>
</band>
</title>
<columnHeader>
<band height="20" splitType="Stretch">
<staticText>
<reportElement uuid="414160e2-41c4-4326-8ec8-ff7c230ac2c3" mode="Opaque" x="0" y="0" width="100" height="20" forecolor="#000000" backcolor="#3399FF"/>
<box leftPadding="10" rightPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Id]]></text>
</staticText>
<staticText>
<reportElement uuid="414160e2-41c4-4326-8ec8-ff7c230ac2c3" mode="Opaque" x="200" y="0" width="100" height="20" forecolor="#000000" backcolor="#3399FF"/>
<box leftPadding="10" rightPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Cost]]></text>
</staticText>
<staticText>
<reportElement uuid="414160e2-41c4-4326-8ec8-ff7c230ac2c3" mode="Opaque" x="100" y="0" width="100" height="20" forecolor="#000000" backcolor="#3399FF"/>
<box leftPadding="10" rightPadding="10">
<topPen lineWidth="1.0"/>
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Name]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<textField>
<reportElement uuid="5715c691-0b39-4530-9009-3b7179bb06f5" x="0" y="0" width="100" height="20"/>
<box leftPadding="10" rightPadding="10">
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{ID}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="5715c691-0b39-4530-9009-3b7179bb06f5" x="100" y="0" width="100" height="20"/>
<box leftPadding="10">
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement/>
<textFieldExpression><![CDATA[$F{NAME}]]></textFieldExpression>
</textField>
<textField>
<reportElement uuid="5715c691-0b39-4530-9009-3b7179bb06f5" x="200" y="0" width="100" height="20"/>
<box leftPadding="10" rightPadding="10">
<leftPen lineWidth="1.0"/>
<bottomPen lineWidth="1.0"/>
<rightPen lineWidth="1.0"/>
</box>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA[$F{COST}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
The result will be (via iReport preview function):
Details:
In this sample I've used the Commons Lang library v. 3.1. You should add this library to the application's classpath (in my case it was iReport's cp).
I've used the parameter numberOfRepeats (java.lang.Integer) for setting the number of phrases to generate.