This is my code for Grandtotal but it won't have grandtotal ?
<?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="Warehouse" language="groovy" pageWidth="612" pageHeight="792" columnWidth="572" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<queryString language="SQL">
<![CDATA[select * from warehouse]]>
</queryString>
<field name="PlantUnit" class="java.lang.String"/>
<field name="Description" class="java.lang.String"/>
<field name="Size" class="java.lang.String"/>
<field name="Qty" class="java.lang.String"/>
<field name="Unit" class="java.lang.String"/>
<field name="Unit Price" class="java.lang.String"/>
<field name="Amount" class="java.lang.String"/>
<variable name="TotalAmount" class="java.lang.String" calculation="Sum">
<variableExpression><![CDATA[$F{Amount}]]></variableExpression>
</variable>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="40" splitType="Stretch">
<staticText>
<reportElement x="100" y="0" width="409" height="40"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="34" isBold="true"/>
</textElement>
<text><![CDATA[WAREHOUSE]]></text>
</staticText>
</band>
</title>
<pageHeader>
<band height="15" splitType="Stretch">
<textField pattern="MMMMM dd, yyyy">
<reportElement x="457" y="0" width="116" height="15"/>
<textElement textAlignment="Right">
<font fontName="Times New Roman" size="12"/>
</textElement>
<textFieldExpression><![CDATA[new SimpleDateFormat("MMMM dd, yyyy").format(new java.util.Date())]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="12" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10" isBold="true"/>
</textElement>
<text><![CDATA[PU]]></text>
</staticText>
<staticText>
<reportElement x="50" y="0" width="184" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10" isBold="true"/>
</textElement>
<text><![CDATA[DESCRIPTION]]></text>
</staticText>
<staticText>
<reportElement x="234" y="0" width="150" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10" isBold="true"/>
</textElement>
<text><![CDATA[SIZE]]></text>
</staticText>
<staticText>
<reportElement x="384" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10" isBold="true"/>
</textElement>
<text><![CDATA[QTY]]></text>
</staticText>
<staticText>
<reportElement x="434" y="0" width="40" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10" isBold="true"/>
</textElement>
<text><![CDATA[UNIT]]></text>
</staticText>
<staticText>
<reportElement x="473" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" isBold="true"/>
</textElement>
<text><![CDATA[COST]]></text>
</staticText>
<staticText>
<reportElement x="523" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" isBold="true"/>
</textElement>
<text><![CDATA[AMOUNT]]></text>
</staticText>
<rectangle>
<reportElement mode="Transparent" x="0" y="0" width="50" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="50" y="0" width="184" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="234" y="0" width="150" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="384" y="0" width="50" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="434" y="0" width="40" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="474" y="0" width="49" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="523" y="0" width="50" height="12"/>
</rectangle>
</band>
</columnHeader>
<detail>
<band height="12" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{PlantUnit}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="50" y="0" width="184" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{Description}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="234" y="0" width="150" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{Size}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="384" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{Qty}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="433" y="0" width="40" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman" size="10"/>
</textElement>
<textFieldExpression><![CDATA[$F{Unit}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="473" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman"/>
</textElement>
<textFieldExpression><![CDATA[$F{Unit Price}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="523" y="0" width="50" height="12"/>
<textElement textAlignment="Center">
<font fontName="Times New Roman"/>
</textElement>
<textFieldExpression><![CDATA[$F{Amount}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement mode="Transparent" x="0" y="0" width="50" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="50" y="0" width="184" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="234" y="0" width="150" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="384" y="0" width="50" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="434" y="0" width="40" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="474" y="0" width="49" height="12"/>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="523" y="0" width="50" height="12"/>
</rectangle>
</band>
</detail>
<columnFooter>
<band height="12" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="100" height="12"/>
<textElement>
<font fontName="Times New Roman" isBold="true"/>
</textElement>
<text><![CDATA[Total Amount]]></text>
</staticText>
<textField isBlankWhenNull="true">
<reportElement x="473" y="0" width="100" height="12"/>
<textElement textAlignment="Right">
<font fontName="Times New Roman"/>
</textElement>
<textFieldExpression><![CDATA[$V{TotalAmount}]]></textFieldExpression>
</textField>
</band>
</columnFooter>
<pageFooter>
<band height="15" splitType="Stretch">
<textField>
<reportElement x="491" y="0" width="56" height="15"/>
<textElement textAlignment="Right">
<font fontName="Times New Roman" size="12"/>
</textElement>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="547" y="0" width="25" height="15"/>
<textElement>
<font fontName="Times New Roman" size="12"/>
</textElement>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="11" splitType="Stretch"/>
</summary>
</jasperReport>
Further assistance would be appreciated.
You have taken the amount field as string.
<field name="Amount" class="java.lang.String"/>
And your variable type is also string.
<variable name="TotalAmount" class="java.lang.String" calculation="Sum">
<variableExpression><![CDATA[$F{Amount}]]></variableExpression>
</variable>
You need to have Amount and TotalAmount variables to be Integer in order for jasper report to be able to calculate the sum. Hence change it to following:
<field name="Amount" class="java.lang.Integer"/>
and
<variable name="TotalAmount" class="java.lang.Integer" calculation="Sum">
<variableExpression><![CDATA[$F{Amount}]]></variableExpression>
</variable>
Note : If Amount is already String then convert it to Integer and then feed to jasper report.
Related
im trying to use subreports in jaspersoft studio but in the preview the subreport area is always empty, i tried a lot of things but no one is a solution, what am I doing wrong ?
here is my code
<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="Blank_A4" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="4eb55d03-56c6-4337-9b1b-e2f10a2d06d4">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="New Data Adapter"/>
<style name="Style1" forecolor="#C2C2C2"/>
<parameter name="REPORT_ID" class="java.lang.Integer">
<defaultValueExpression><![CDATA[0]]></defaultValueExpression>
</parameter>
<parameter name="CREATED_AT" class="java.sql.Date"/>
<parameter name="AVERAGE_SELL_VALUE" class="java.lang.String"/>
<parameter name="MIN_SELL_VALUE" class="java.lang.String"/>
<parameter name="MAX_SELL_VALUE" class="java.lang.String"/>
<parameter name="AVERAGE_RETAKE_VALUE" class="java.lang.String"/>
<parameter name="MIN_RETAKE_VALUE" class="java.lang.String"/>
<parameter name="MAX_RETAKE_VALUE" class="java.lang.String"/>
<parameter name="BRAND" class="java.lang.String"/>
<parameter name="MODEL" class="java.lang.String"/>
<parameter name="YEAR" class="java.lang.String"/>
<parameter name="VERSION" class="java.lang.String"/>
<parameter name="KM" class="java.lang.String"/>
<parameter name="CYLINDER_CAPACITY" class="java.lang.String"/>
<parameter name="FUEL_TYPE" class="java.lang.String"/>
<parameter name="TRANSMISION" class="java.lang.String"/>
<parameter name="TRACTION" class="java.lang.String"/>
<parameter name="COLOR" class="java.lang.String"/>
<parameter name="PRICE_ADJUST" class="java.lang.String"/>
<parameter name="KM_ADJUST" class="java.lang.String"/>
<parameter name="AVERAGE_VALUE" class="java.lang.String"/>
<queryString language="JSON">
<![CDATA[report_url]]>
</queryString>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="73" splitType="Stretch">
<textField>
<reportElement x="475" y="5" width="135" height="30" forecolor="#888888" uuid="e2639b23-eddb-4d9a-a25e-f0f153aa991b"/>
<textFieldExpression><![CDATA[$P{REPORT_ID}]]></textFieldExpression>
</textField>
<image>
<reportElement x="5" y="5" width="110" height="40" uuid="e2cc72cc-5ada-47c0-a442-74b0bdc14af6"/>
<imageExpression><![CDATA["/home/jaimo/Descargas/Group 1.svg"]]></imageExpression>
</image>
<line>
<reportElement x="125" y="23" width="1" height="15" forecolor="#888888" uuid="0bfa9970-6235-4cad-b1e3-16ca2899131c">
<property name="com.jaspersoft.studio.unit.x" value="px"/>
<property name="com.jaspersoft.studio.unit.width" value="px"/>
<property name="com.jaspersoft.studio.unit.height" value="px"/>
</reportElement>
</line>
<textField>
<reportElement x="475" y="20" width="101" height="30" forecolor="#888888" uuid="45a9e1de-56fa-49eb-95e2-85c2c1c06dc1">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font size="11"/>
</textElement>
<textFieldExpression><![CDATA[$P{CREATED_AT}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="135" y="15" width="178" height="30" forecolor="#888888" uuid="9ce24531-f175-4d0d-9759-e9535850818d"/>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[Informe de tasación]]></text>
</staticText>
<staticText>
<reportElement x="316" y="5" width="141" height="30" forecolor="#14344A" uuid="a6e2f389-858b-448a-844f-ed88681760fe"/>
<textElement textAlignment="Right">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Id Informe:]]></text>
</staticText>
<staticText>
<reportElement x="315" y="20" width="141" height="30" forecolor="#14344A" uuid="a62ca2cd-33e9-47d2-885f-b9fede598ff4">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement textAlignment="Right">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[fecha de emisión:]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="580">
<rectangle radius="10">
<reportElement x="5" y="55" width="260" height="340" forecolor="#5F6C75" uuid="a58c5d5c-b271-47e4-aa61-8c08a244322b"/>
</rectangle>
<rectangle radius="10">
<reportElement x="286" y="55" width="272" height="160" uuid="170a4d89-8ed9-491f-b862-1b9c708e651f"/>
</rectangle>
<rectangle radius="10">
<reportElement x="286" y="235" width="272" height="160" uuid="d1b5568e-f4be-4cfa-a8cc-6d761b69cbaf"/>
</rectangle>
<textField>
<reportElement x="308" y="125" width="149" height="40" forecolor="#373737" uuid="90c5e1eb-1aa2-49bd-a8f7-574d7a11d694"/>
<textElement verticalAlignment="Middle">
<font size="24" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["$" +$P{AVERAGE_SELL_VALUE}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="308" y="165" width="219" height="30" forecolor="#5F6C75" uuid="d9a02936-a161-4e50-81dd-bf1e84db717a">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA["Rango: $" + $P{MIN_SELL_VALUE} + " / $" + $P{MAX_SELL_VALUE}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="25" y="65" width="100" height="30" forecolor="#373737" uuid="45ac0bb9-dfa0-43d0-a28f-0f08225492f6"/>
<textElement verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Marca:]]></text>
</staticText>
<staticText>
<reportElement x="24" y="95" width="100" height="30" forecolor="#373737" uuid="0f81a7ce-35c7-4cf5-b46f-ce01e2e61cc7"/>
<textElement verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Modelo:]]></text>
</staticText>
<staticText>
<reportElement x="24" y="125" width="100" height="30" forecolor="#373737" uuid="a84b857a-04af-492a-9140-7f734b4b341b"/>
<textElement verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Año:]]></text>
</staticText>
<staticText>
<reportElement x="24" y="155" width="100" height="30" forecolor="#373737" uuid="1498a093-14cc-4dfd-9590-d805b492ed95"/>
<textElement verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Versión:]]></text>
</staticText>
<staticText>
<reportElement x="24" y="185" width="100" height="30" forecolor="#373737" uuid="96a49dab-037c-44bf-8447-e1789ecc4c0a"/>
<textElement verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[KM:]]></text>
</staticText>
<staticText>
<reportElement x="24" y="215" width="100" height="30" forecolor="#373737" uuid="0e5d5220-2bcc-4c6a-9ab2-35e1b0599a2b"/>
<textElement verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Cilindrada:]]></text>
</staticText>
<staticText>
<reportElement x="24" y="245" width="100" height="30" forecolor="#373737" uuid="33ac256b-af52-4f8b-ad65-10db6f634839"/>
<textElement verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Combustible:]]></text>
</staticText>
<staticText>
<reportElement x="24" y="275" width="100" height="30" forecolor="#373737" uuid="a2ce1334-6202-4377-89dd-b1e0baae6260"/>
<textElement verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Transmisión:]]></text>
</staticText>
<staticText>
<reportElement x="24" y="305" width="100" height="30" forecolor="#373737" uuid="b696d922-ba43-4567-869c-de9cb3c6c9a4"/>
<textElement verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Tracción:]]></text>
</staticText>
<staticText>
<reportElement x="24" y="335" width="100" height="30" forecolor="#373737" uuid="a49c4cce-9f76-4360-ac4b-dcab33467bca"/>
<textElement verticalAlignment="Middle">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Color:]]></text>
</staticText>
<textField>
<reportElement x="124" y="66" width="130" height="30" forecolor="#5F6C75" uuid="eb22f28d-68cc-47ce-a208-8bcae9792fa9"/>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{BRAND}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="124" y="95" width="130" height="30" forecolor="#5F6C75" uuid="b4480708-0492-49ee-8ff3-d5789b5dbaa8"/>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{MODEL}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="124" y="125" width="130" height="30" forecolor="#5F6C75" uuid="cf88497c-1d1a-4ea2-8bdd-e6e2209c60b9"/>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{YEAR}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="124" y="155" width="130" height="30" forecolor="#5F6C75" uuid="1a88da33-0b39-40de-a348-ca95b83a56c3"/>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{VERSION}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="124" y="185" width="130" height="30" forecolor="#5F6C75" uuid="688eace4-c2fe-4259-88a9-7d7e1af8d04c"/>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{KM} + "(*)"]]></textFieldExpression>
</textField>
<textField>
<reportElement x="125" y="215" width="129" height="30" forecolor="#5F6C75" uuid="7249875a-c675-4d38-b4aa-c20fd1d5eaaa"/>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{CYLINDER_CAPACITY}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="124" y="245" width="130" height="30" forecolor="#5F6C75" uuid="33531f34-34c8-4f2b-92f3-f5ba68111cae"/>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{FUEL_TYPE}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="124" y="275" width="130" height="30" forecolor="#5F6C75" uuid="36733743-1493-4817-bccc-89354c405821"/>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{TRANSMISION}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="124" y="305" width="130" height="30" forecolor="#5F6C75" uuid="d484ecbc-e947-44e6-9a51-55f985f6663c"/>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{TRACTION}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="124" y="335" width="130" height="30" forecolor="#5F6C75" uuid="80aa9276-a814-484a-8604-dc0a6057aab8"/>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA[$P{COLOR}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="25" y="360" width="230" height="30" forecolor="#5F6C75" uuid="3e0ddb85-12f4-4398-b318-eb6aedf1cc7f">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font size="12"/>
</textElement>
<text><![CDATA[(*) Promedio de km según antigüedad del vehiculo]]></text>
</staticText>
<staticText>
<reportElement x="305" y="245" width="240" height="20" forecolor="#14344A" uuid="fbddbb33-251d-4cbb-94c3-e324504b44a5"/>
<textElement verticalAlignment="Middle">
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Valor en recepción en parte de pago]]></text>
</staticText>
<staticText>
<reportElement x="305" y="265" width="240" height="40" forecolor="#888888" uuid="775a79e7-7d53-44d4-a885-d66f25181fa0"/>
<textElement verticalAlignment="Middle"/>
<text><![CDATA[Precio promedio, máximo y mínimo al entregar el vehículo como parte de pago de otro vehículo.]]></text>
</staticText>
<staticText>
<reportElement x="308" y="65" width="237" height="30" forecolor="#14344A" uuid="efdf8857-7032-482d-8c46-bd2768ae1120"/>
<textElement verticalAlignment="Middle">
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Valor estimado de venta]]></text>
</staticText>
<textField>
<reportElement x="305" y="305" width="222" height="40" forecolor="#373737" uuid="da02e43b-7bea-42ca-9885-739414847863"/>
<textElement verticalAlignment="Middle">
<font size="24" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA["$" +$P{AVERAGE_RETAKE_VALUE}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="305" y="345" width="219" height="30" forecolor="#5F6C75" uuid="07c566a7-bd8c-46d2-b1b8-6ad1839ddfa7">
<property name="com.jaspersoft.studio.unit.y" value="px"/>
</reportElement>
<textElement>
<font size="12"/>
</textElement>
<textFieldExpression><![CDATA["Rango: $" + $P{MIN_RETAKE_VALUE} + " / $" + $P{MAX_RETAKE_VALUE}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="306" y="85" width="240" height="40" forecolor="#888888" uuid="4b05c58f-9941-4649-9b0d-98facaae4260"/>
<textElement textAlignment="Left" verticalAlignment="Middle"/>
<text><![CDATA[Precio promedio, máximo y mínimo de venta del vehículo.]]></text>
</staticText>
<image>
<reportElement x="15" y="10" width="30" height="30" uuid="f82c5f90-dada-4f88-a2c2-849bbc925556"/>
<imageExpression><![CDATA["/home/jaimo/Descargas/jasper_icons/single_car_icon.svg"]]></imageExpression>
</image>
<staticText>
<reportElement x="56" y="5" width="199" height="40" forecolor="#14344A" uuid="87f30195-0739-4c08-a782-6cf92a464de7"/>
<textElement verticalAlignment="Middle">
<font size="18"/>
</textElement>
<text><![CDATA[Datos del vehículo]]></text>
</staticText>
<subreport>
<reportElement x="0" y="430" width="558" height="120" uuid="7b860fe8-8737-46c2-8fc5-9747720f3abd"/>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA["subreport.jasper"]]></subreportExpression>
</subreport>
</band>
</columnHeader>
<pageFooter>
<band height="121" splitType="Stretch">
<image>
<reportElement x="-20" y="0" width="450" height="121" uuid="618a75d4-e981-47c5-b316-266e3b91666c"/>
<imageExpression><![CDATA["/home/jaimo/Descargas/miscelaneas.svg"]]></imageExpression>
</image>
<textField>
<reportElement x="470" y="45" width="100" height="30" uuid="b9eeb12e-542b-4da0-a6ce-64e071382a81"/>
<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
</jasperReport>
and here is subreport expression
<subreport>
<reportElement x="0" y="430" width="558" height="120" uuid="7b860fe8-8737-46c2-8fc5-9747720f3abd"/>
<connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>
<subreportExpression><![CDATA["subreport.jasper"]]></subreportExpression>
</subreport>
I am using japer 3.7.6 in my project.Jasper works good locally in my computer.When the same project is hosted in linux server there appears this issue.For some reports jasper is working but in some reports it shows following error :
In Firefox :
In Chrome:
My jasper report code is like this:
<?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="shareDividentReport_np" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" isSummaryNewPage="true">
<property name="com.jaspersoft.studio.data.defaultdataadapter" value="One Empty Record"/>
<property name="com.jaspersoft.studio.report.description" value=""/>
<property name="ireport.zoom" value="1.652892561983471"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="address" class="java.lang.String"/>
<parameter name="institutionName" class="java.lang.String"/>
<parameter name="scheme" class="java.lang.String"/>
<parameter name="trxnDate" class="java.lang.String"/>
<queryString>
<![CDATA[]]>
</queryString>
<field name="custName" class="java.lang.String">
<fieldDescription><![CDATA[custName]]></fieldDescription>
</field>
<field name="sNo" class="java.lang.Integer"/>
<field name="address" class="java.lang.String">
<fieldDescription><![CDATA[address]]></fieldDescription>
</field>
<field name="accNo" class="java.lang.String"/>
<field name="amount" class="java.math.BigDecimal"/>
<field name="remarks" class="java.lang.String"/>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="61" splitType="Stretch">
<textField>
<reportElement x="337" y="19" width="215" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{address}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="305" y="-1" width="247" height="20"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{institutionName}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="3" y="2" width="142" height="22"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" isBold="true"/>
</textElement>
<text><![CDATA[Fund Distribution Report]]></text>
</staticText>
<staticText>
<reportElement x="400" y="41" width="81" height="14"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
<text><![CDATA[Transaction Date :]]></text>
</staticText>
<staticText>
<reportElement x="3" y="41" width="73" height="14"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" size="8" isBold="true"/>
</textElement>
<text><![CDATA[Scheme Name :]]></text>
</staticText>
<textField>
<reportElement x="77" y="41" width="124" height="14"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{scheme}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="481" y="41" width="70" height="14"/>
<textElement verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{trxnDate}]]></textFieldExpression>
</textField>
</band>
</title>
<columnHeader>
<band height="17" splitType="Stretch">
<staticText>
<reportElement x="3" y="1" width="22" height="14"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[#]]></text>
</staticText>
<line>
<reportElement x="1" y="0" width="554" height="1"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<line>
<reportElement x="0" y="0" width="1" height="16"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<line>
<reportElement x="1" y="16" width="554" height="1"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<line>
<reportElement x="25" y="0" width="1" height="16"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<line>
<reportElement x="131" y="1" width="1" height="16"/>
</line>
<staticText>
<reportElement x="28" y="1" width="106" height="14"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Name]]></text>
</staticText>
<line>
<reportElement x="201" y="1" width="1" height="16"/>
<graphicElement>
<pen lineWidth="0.5"/>
</graphicElement>
</line>
<staticText>
<reportElement x="204" y="1" width="58" height="14"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Acc No]]></text>
</staticText>
<line>
<reportElement x="261" y="1" width="1" height="16"/>
</line>
<line>
<reportElement x="368" y="1" width="1" height="16"/>
</line>
<line>
<reportElement x="554" y="1" width="1" height="16"/>
</line>
<staticText>
<reportElement x="134" y="1" width="68" height="14"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Address]]></text>
</staticText>
<staticText>
<reportElement x="262" y="0" width="107" height="17">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="1e3ff973-33f4-46e2-8c61-70a570ebcd40"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Amount]]></text>
</staticText>
<staticText>
<reportElement x="370" y="0" width="184" height="17">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="5f9168c6-3ec7-40d1-92ec-fd6608f42808"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<text><![CDATA[Remarks]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="17" splitType="Stretch">
<line>
<reportElement x="0" y="-1" width="1" height="16" isPrintWhenDetailOverflows="true"/>
</line>
<line>
<reportElement positionType="Float" x="25" y="0" width="1" height="16" isPrintWhenDetailOverflows="true"/>
</line>
<line>
<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="131" y="-1" width="1" height="16" isPrintWhenDetailOverflows="true"/>
</line>
<line>
<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="201" y="0" width="1" height="16" isPrintWhenDetailOverflows="true"/>
</line>
<line>
<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="261" y="0" width="1" height="16" isPrintWhenDetailOverflows="true"/>
</line>
<line>
<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="368" y="0" width="1" height="16" isPrintWhenDetailOverflows="true"/>
</line>
<line>
<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="554" y="-1" width="1" height="16" isPrintWhenDetailOverflows="true"/>
</line>
<line>
<reportElement x="0" y="15" width="554" height="1"/>
</line>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement positionType="Float" stretchType="RelativeToBandHeight" x="30" y="-1" width="100" height="16">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="737f7de1-b4b4-49bd-8d44-4fa181039ac1"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{custName}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="0" y="-1" width="25" height="16">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="d6382c06-3ada-460a-9cd4-eb3c7a6404b9"/>
<printWhenExpression><![CDATA[$F{sNo}>0]]></printWhenExpression>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.Integer"><![CDATA[$F{sNo}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="135" y="-1" width="66" height="16">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="18069ac2-9301-4317-b20a-447a97937054"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{address}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement x="202" y="-1" width="56" height="16">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="fb1cc6a9-727b-4827-847a-48952b87e8ba"/>
</reportElement>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{accNo}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="262" y="-1" width="101" height="16">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="8a107053-079b-4a12-83ed-5ec9e16a7613"/>
</reportElement>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{amount}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="373" y="-1" width="181" height="16">
<property name="com.jaspersoft.studio.spreadsheet.connectionID" value="421fa618-29d6-4861-b625-ffa1e0b8d73a"/>
</reportElement>
<textElement verticalAlignment="Middle">
<font fontName="Arial" size="8"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{remarks}]]></textFieldExpression>
</textField>
</band>
</detail>
</jasperReport>
Similarly code to print is like this:
JasperPrint jasperPrint;
try {
jasperPrint = JasperFillManager.fillReport(reportPath, params,
new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource(lstFundDistReport));
HttpServletResponse httpServletResponse = (HttpServletResponse) FacesContext.getCurrentInstance()
.getExternalContext().getResponse();
httpServletResponse.addHeader("Content-disposition", "inline; filename=FundDistReport.pdf");
ServletOutputStream servletOutputStream = httpServletResponse.getOutputStream();
JasperExportManager.exportReportToPdfStream(jasperPrint, servletOutputStream);
FacesContext.getCurrentInstance().responseComplete();
servletOutputStream.close();
} catch (Exception e) {
// TODO Auto-generated catch block
e.printStackTrace();
}
I have used same code to print different reports in my application.I repeat in local computer every reports are working fine.But same application hosted in Linux server gives such unusual error. Some reports are exported to pdf but majorly this issue appears for others reports.
The objective of my study is to print a table that I have on SQL Server, the data connecting is done, the interface and the printing are done too.
The problem occurs when I print the PDf of the report because I want to print a number of rows per page but it only prints me one row of the table per page, so if my table has 205 rows, it prints 205 pages, haha, kinda weird.
This is my first time using JasperReports. Here is my 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="listadoCensosDiarios" language="groovy" printOrder="Horizontal" pageWidth="2400" pageHeight="1000" orientation="Landscape" columnWidth="2360" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="d8233986-9ca6-4eb9-852a-0c0bf896d505">
<parameter name="ruta" class="java.lang.String"/>
<field name="CodigoCama" class="java.lang.String"/>
<field name="Documento" class="java.lang.String"/>
<field name="Nombre" class="java.lang.String"/>
<field name="Edad" class="java.lang.String"/>
<field name="Empresa" class="java.lang.String"/>
<field name="Especialista" class="java.lang.String"/>
<field name="Diagnostico" class="java.lang.String"/>
<field name="FechaIngreso" class="java.lang.String"/>
<field name="Dias" class="java.lang.String"/>
<field name="Dieta" class="java.lang.String"/>
<field name="Observaciones" class="java.lang.String"/>
<field name="Registrado" class="java.lang.String"/>
<field name="FechaRegistro" class="java.lang.String"/>
<variable name="totalPaginas" class="java.lang.Integer" resetType="Page" incrementType="Report" calculation="Count"/>
<title>
<band height="58" splitType="Stretch">
<rectangle>
<reportElement uuid="df0fa9dd-b7f1-4800-b1bf-f40de1bc7263" x="64" y="1" width="1801" height="50" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="f773ff3c-e683-41f4-8f16-7d8c66d54562" mode="Opaque" x="64" y="2" width="1801" height="48" backcolor="#E0E0E0"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="20" isBold="true"/>
</textElement>
<text><![CDATA[CENSO DIARIO]]></text>
</staticText>
<rectangle>
<reportElement uuid="07b7d0a3-0b20-4649-a1b2-0045ca40372e" x="1" y="1" width="63" height="50" backcolor="#E0E0E0"/>
</rectangle>
<rectangle>
<reportElement uuid="e076ba71-8906-4238-a19d-f75077425de6" x="1865" y="1" width="134" height="50" backcolor="#E2DEDE"/>
</rectangle>
<image hAlign="Center" vAlign="Middle">
<reportElement uuid="e0c8b5d2-3f68-4895-adea-e98d58a2ea3e" x="1" y="2" width="63" height="47"/>
<imageExpression><![CDATA[$P{ruta}+"//img//LOGO1.png"]]></imageExpression>
</image>
<image hAlign="Center" vAlign="Middle">
<reportElement uuid="ce929fc5-57d6-4e20-b30c-9893f34edf61" x="1901" y="3" width="58" height="46"/>
<imageExpression><![CDATA[$P{ruta}+"//img//100calidad.jpg"]]></imageExpression>
</image>
</band>
</title>
<pageHeader>
<band height="24" splitType="Stretch">
<rectangle>
<reportElement uuid="b28a6cd6-7bb8-4332-a443-795537750291" x="0" y="8" width="1629" height="16" backcolor="#D3ECC7"/>
</rectangle>
<rectangle>
<reportElement uuid="da28e036-684a-4921-a42a-4afab1ff613a" x="1629" y="8" width="370" height="16" backcolor="#D3ECC7"/>
</rectangle>
<staticText>
<reportElement uuid="4ec9e82c-884b-49ea-9d84-41ef79374f2d" mode="Opaque" x="1632" y="10" width="360" height="14" backcolor="#D3ECC7"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="11" isBold="true"/>
</textElement>
<text><![CDATA[Información del Empleado]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="23" splitType="Stretch">
<rectangle>
<reportElement uuid="0ed0631b-b8b3-4544-984a-6a8b152405a4" x="145" y="1" width="169" height="22" backcolor="#E0E0E0"/>
</rectangle>
<rectangle>
<reportElement uuid="5d9afa11-5f66-4c24-a689-790b6bbbfee8" x="0" y="1" width="52" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="d3cbfe71-89c2-40f4-83be-c388d60d1f57" mode="Transparent" x="10" y="0" width="39" height="22" backcolor="#E0E0E0"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Cama]]></text>
</staticText>
<rectangle>
<reportElement uuid="6e7ec76b-c44c-4ae1-8b14-868e9f596876" x="314" y="1" width="35" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="afc00f8f-d646-48be-b883-11beb5e4e5b3" x="318" y="1" width="25" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Edad]]></text>
</staticText>
<rectangle>
<reportElement uuid="065d81fe-b21e-4982-9843-c874f499a969" x="349" y="1" width="150" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="1215c9ac-9bc5-428d-9456-4c9c0ce81129" x="351" y="1" width="145" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Empresa]]></text>
</staticText>
<rectangle>
<reportElement uuid="9066f537-b0d4-4a43-b544-14704b4fc207" x="499" y="1" width="150" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="6ba919d0-8dc8-421e-890d-4d9e9bcdf639" x="501" y="1" width="146" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Especialista]]></text>
</staticText>
<rectangle>
<reportElement uuid="efeb1184-587c-43ce-bca3-3e6b25f10ea6" x="649" y="1" width="206" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="bc197cfe-a855-4da3-b25e-2d602e16e5c5" x="670" y="1" width="164" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Diagnostico]]></text>
</staticText>
<rectangle>
<reportElement uuid="b9dadc2e-8f0d-481d-a82d-f6f47263ef18" x="855" y="1" width="209" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="7c51754f-552c-445e-b7f4-668375f96f3b" x="868" y="1" width="183" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Fecha Ingreso Paciente]]></text>
</staticText>
<rectangle>
<reportElement uuid="efe37924-5b8b-46bb-b7ab-c35ec15f16f7" x="1173" y="1" width="156" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="4360b926-3429-4bcf-bf76-28c6ed3af80f" x="1219" y="1" width="65" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Dieta]]></text>
</staticText>
<rectangle>
<reportElement uuid="53b0b7be-341c-4d88-9d06-e9ce66f2ba38" x="1329" y="1" width="300" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="739a0a28-415c-4f19-97e7-0eb4d1967f0c" x="1346" y="1" width="269" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Observaciones]]></text>
</staticText>
<rectangle>
<reportElement uuid="5c0eb8ea-abbb-430f-8faf-bdc507ccdc43" x="1064" y="1" width="109" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="f620ed1e-a0a1-448f-a9cd-13b0824dda53" x="1064" y="1" width="98" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Dias Estancia]]></text>
</staticText>
<rectangle>
<reportElement uuid="f0ac1173-7313-46cb-bf0c-072abc746810" x="1629" y="1" width="250" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="f0650ba4-1a18-4ff8-b514-928fad9c0e47" x="1629" y="1" width="250" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Registrado Por]]></text>
</staticText>
<rectangle>
<reportElement uuid="ea2a4a77-fe25-4b62-8730-b04158cc4f43" x="1879" y="1" width="120" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="051cd84a-f45a-43ae-8e50-476a1723acdd" x="1879" y="1" width="120" height="22"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Fecha Registro]]></text>
</staticText>
<rectangle>
<reportElement uuid="146c7aa0-b3cd-496d-a9c7-49b74c37bd64" x="52" y="1" width="93" height="22" backcolor="#E0E0E0"/>
</rectangle>
<staticText>
<reportElement uuid="f657cfd7-da85-4e30-86ec-720183dbd38b" mode="Transparent" x="52" y="1" width="93" height="22" backcolor="#E0E0E0"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="9" isBold="true"/>
</textElement>
<text><![CDATA[Documento]]></text>
</staticText>
<staticText>
<reportElement uuid="64287559-c995-45ba-b97f-dbfbecf62eab" mode="Transparent" x="145" y="2" width="169" height="21" backcolor="#E0E0E0"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8" isBold="true"/>
</textElement>
<text><![CDATA[Nombre(s) y Apellidos]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="626" splitType="Stretch">
<rectangle>
<reportElement uuid="ce513dc9-595a-4018-9b60-4184a87400cf" x="52" y="0" width="93" height="59"/>
</rectangle>
<rectangle>
<reportElement uuid="633a32fe-76d0-478c-a2e8-ef73630b698d" x="0" y="0" width="52" height="59"/>
</rectangle>
<textField isBlankWhenNull="true">
<reportElement uuid="d1b97bd4-4e00-4aae-a0eb-d9532314933f" x="3" y="0" width="46" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{CodigoCama}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement uuid="58f022c4-755c-4341-9de7-152dbb01092b" x="145" y="0" width="169" height="59"/>
</rectangle>
<rectangle>
<reportElement uuid="9236e426-7562-40b9-8c87-02a31d29dacf" x="314" y="0" width="35" height="59"/>
</rectangle>
<textField isBlankWhenNull="true">
<reportElement uuid="d77071b7-c1cc-40e8-ab57-92ad08278390" x="316" y="0" width="29" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{Edad}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement uuid="76fa21b9-c41d-46bc-8c50-dee329b8c61c" x="349" y="0" width="150" height="59"/>
</rectangle>
<textField isBlankWhenNull="true">
<reportElement uuid="81c4e8ba-6de5-471d-b8ca-3e9984105a99" x="354" y="0" width="140" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{Empresa}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement uuid="836b0a1d-4268-4668-a63e-4df1b4834662" x="499" y="0" width="150" height="59"/>
</rectangle>
<textField isBlankWhenNull="true">
<reportElement uuid="e0ee8d88-5ef1-4e7e-b534-c5cef786c942" x="505" y="0" width="140" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{Especialista}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement uuid="49535787-c02d-4d34-9b83-ed192e0fb086" x="855" y="0" width="209" height="59"/>
</rectangle>
<textField isBlankWhenNull="true">
<reportElement uuid="0a4641d9-76f8-4081-ba53-7d68e9934176" x="865" y="0" width="190" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{FechaIngreso}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement uuid="e4187b85-1c21-4041-8e0e-2c1a6f02cb72" x="1173" y="0" width="156" height="59"/>
</rectangle>
<textField isBlankWhenNull="true">
<reportElement uuid="7883fd8a-e3f2-4930-8ec0-37fdb76f4fa4" x="1184" y="0" width="132" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{Dieta}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement uuid="1a80ef21-1caa-46c2-a1ff-69a810997625" x="1329" y="0" width="300" height="59"/>
</rectangle>
<textField isBlankWhenNull="true">
<reportElement uuid="cb697e3d-c8e0-4c98-a588-1eb92008d1f5" x="1345" y="0" width="269" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{Observaciones}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement uuid="6e960357-27ac-4411-b0ab-1dc6c2bc101b" x="1064" y="0" width="109" height="59"/>
</rectangle>
<rectangle>
<reportElement uuid="3eca5ca2-a90b-4c1c-96d4-2ff47b699044" x="1879" y="0" width="120" height="59"/>
</rectangle>
<textField isBlankWhenNull="true">
<reportElement uuid="548dcabc-6708-4a4b-902a-7fd7cc30f26c" x="1897" y="0" width="93" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{FechaRegistro}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="2cc8851f-d3b4-44cf-a97c-4ad7544765b5" x="59" y="0" width="79" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{Documento}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement uuid="641978c2-69fc-45f3-a96c-25a53aa138b5" x="1629" y="0" width="250" height="59"/>
</rectangle>
<textField isBlankWhenNull="true">
<reportElement uuid="66b12f81-615c-4bb7-8c18-3ce2f0e877d6" x="1635" y="0" width="236" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{Registrado}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="0a4641d9-76f8-4081-ba53-7d68e9934176" x="1069" y="1" width="98" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{Dias}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement uuid="8e458e73-d0fb-4707-b4b8-dd34642725af" x="151" y="1" width="155" height="59"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{Nombre}]]></textFieldExpression>
</textField>
<rectangle>
<reportElement uuid="e021e007-7a56-4ebe-a617-ab39f21dbb32" x="649" y="0" width="206" height="59"/>
</rectangle>
<textField isBlankWhenNull="true">
<reportElement uuid="61d0b9e9-f314-44a3-8aa4-ead1d3e726b6" x="659" y="0" width="185" height="58"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font size="8"/>
</textElement>
<textFieldExpression><![CDATA[$F{Diagnostico}]]></textFieldExpression>
</textField>
</band>
</detail>
<pageFooter>
<band height="140" splitType="Stretch"/>
</pageFooter>
</jasperReport>
I tried with a page break but I got the same result.
Your detail band is too tall. Set its height to match the tallest element in the band, that is 59 pixels.
I have a report that i am making using iReport and I have an equation that is helping me find duplicate Estimated Shipping variables and make the initial number stay the same but the ones displayed after it appear as 0. I want this because the report shows the changes made to the Sales Order but I dont want the report showing that the person was charged the initial Estimated Shipping ammount- every time.
The equation I am using to find the duplicates is
$V{SOID_Count}<=1?$F{SOITEM_UNITPRICE}:0
This works but if you notice in this picture the numbers are behind by one.
It is subtracting the Estimated Shipping amount that was above it- from the current Actual Shipping amount that you are on.
So how can I alter my counter equation to fix this?
Thank you for any help!
This is my XML
<?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="ShippingPriceDifference" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="97636279-f825-4b72-b9f8-8ce9740dce34">
<property name="ireport.zoom" value="1.5"/>
<property name="ireport.x" value="0"/>
<property name="ireport.y" value="0"/>
<parameter name="To" class="java.util.Date">
<parameterDescription><![CDATA[asdf]]></parameterDescription>
</parameter>
<parameter name="From" class="java.util.Date"/>
<queryString>
<![CDATA[SELECT
CUSTOMER."NAME" AS CUSTOMER_NAME,
SO."NUM" AS SO_NUM,
COMPANY."NAME" AS COMPANY_NAME,
SHIPCARTON."FREIGHTAMOUNT" AS SHIPCARTON_FREIGHTAMOUNT,
SHIP."SOID" AS SHIP_SOID,
SOITEM."UNITPRICE" AS SOITEM_UNITPRICE,
PRODUCT."PARTID" AS PRODUCT_PARTID,
SHIP."DATESHIPPED" AS SHIP_DATESHIPPED,
SOITEM."SOID" AS SOITEM_SOID
FROM
"CUSTOMER" CUSTOMER INNER JOIN "SO" SO ON CUSTOMER."ID" = SO."CUSTOMERID"
INNER JOIN "SHIP" SHIP ON SO."ID" = SHIP."SOID"
INNER JOIN "SOITEM" SOITEM ON SO."ID" = SOITEM."SOID"
INNER JOIN "PRODUCT" PRODUCT ON SOITEM."PRODUCTID" = PRODUCT."ID"
INNER JOIN "SHIPCARTON" SHIPCARTON ON SHIP."ID" = SHIPCARTON."SHIPID",
"COMPANY" COMPANY
WHERE
PRODUCT."PARTID" = 947
AND SHIP."DATESHIPPED" BETWEEN $P{From} AND $P{To}
AND SHIPCARTON."FREIGHTAMOUNT" != 0
ORDER BY
2 ASC]]>
</queryString>
<field name="CUSTOMER_NAME" class="java.lang.String"/>
<field name="SO_NUM" class="java.lang.String"/>
<field name="COMPANY_NAME" class="java.lang.String"/>
<field name="SHIPCARTON_FREIGHTAMOUNT" class="java.lang.Double"/>
<field name="SHIP_SOID" class="java.lang.Integer"/>
<field name="SOITEM_UNITPRICE" class="java.lang.Double"/>
<field name="PRODUCT_PARTID" class="java.lang.Integer"/>
<field name="SHIP_DATESHIPPED" class="java.sql.Timestamp"/>
<field name="SOITEM_SOID" class="java.lang.Integer"/>
<variable name="shipPriceDif" class="java.lang.Double">
<variableExpression><![CDATA[($F{SHIPCARTON_FREIGHTAMOUNT})- ($V{estimatedShipping})]]></variableExpression>
</variable>
<variable name="totalShipPriceDif" class="java.lang.Double" calculation="Sum">
<variableExpression><![CDATA[$V{shipPriceDif}]]></variableExpression>
</variable>
<variable name="SOID_Count" class="java.lang.Integer" resetType="Group" resetGroup="SOID" calculation="Count">
<variableExpression><![CDATA[$F{SOITEM_SOID}]]></variableExpression>
</variable>
<variable name="estimatedShipping" class="java.lang.Double">
<variableExpression><![CDATA[$V{SOID_Count}<=1?$F{SOITEM_UNITPRICE}:0]]> </variableExpression>
</variable>
<group name="SOID">
<groupExpression><![CDATA[$F{SOITEM_SOID}]]></groupExpression>
</group>
<background>
<band splitType="Stretch"/>
</background>
<title>
<band height="27" splitType="Stretch">
<textField>
<reportElement x="0" y="0" width="555" height="25" uuid="64a1704a-b221-48a4-8186-1b855ead5acf"/>
<textElement textAlignment="Center">
<font fontName="SansSerif" size="16" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$F{COMPANY_NAME}]]></textFieldExpression>
</textField>
</band>
</title>
<pageHeader>
<band height="59" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="555" height="25" uuid="e20cae54-5d75-4e81-800c-55390d1ec465"/>
<textElement textAlignment="Center">
<font fontName="SansSerif" size="14"/>
</textElement>
<text><![CDATA[Shipping Price Difference ]]></text>
</staticText>
<staticText>
<reportElement x="0" y="25" width="167" height="20" uuid="41be06d8-8fdf-4e3b-b526-1aea092ea734"/>
<textElement textAlignment="Right">
<font fontName="SansSerif" size="14" isBold="false"/>
</textElement>
<text><![CDATA[Date Range:]]></text>
</staticText>
<staticText>
<reportElement x="267" y="25" width="20" height="20" uuid="a402544b-73b3-4132-8161-be4c202e9b14"/>
<textElement textAlignment="Center">
<font fontName="SansSerif" size="14" isBold="false"/>
</textElement>
<text><![CDATA[-]]></text>
</staticText>
<textField>
<reportElement x="287" y="25" width="100" height="20" uuid="85e7fe2b-8149-4b18-8410-16b026cdb0f3"/>
<textElement verticalAlignment="Middle">
<font fontName="SansSerif" size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{To}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="167" y="25" width="100" height="20" uuid="ea618bea-9201-4eba-abff-cfdc891ac76f"/>
<textElement textAlignment="Right" verticalAlignment="Middle">
<font fontName="SansSerif" size="14"/>
</textElement>
<textFieldExpression><![CDATA[$P{From}]]></textFieldExpression>
</textField>
</band>
</pageHeader>
<columnHeader>
<band height="21" splitType="Stretch">
<staticText>
<reportElement x="0" y="0" width="140" height="20" uuid="82883a63-752d-4265-8158-a5129b617b7d"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Customer Name]]></text>
</staticText>
<staticText>
<reportElement x="140" y="0" width="75" height="20" uuid="2d302854-c68c-4e5a-b94b-900c88937b9d"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[SO #]]></text>
</staticText>
<staticText>
<reportElement x="455" y="0" width="100" height="20" uuid="50c6ba0f-a5df-4aa3-8a47-282271055053"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Difference]]></text>
</staticText>
<line>
<reportElement x="0" y="19" width="555" height="1" uuid="be790d1c-d6d6-4169-b743-a98654c025e9"/>
</line>
<staticText>
<reportElement x="215" y="0" width="120" height="20" uuid="ffbe1333-86b8-435f-b914-46bb1c747683"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Estimated Shipping]]></text>
</staticText>
<staticText>
<reportElement x="335" y="0" width="120" height="20" uuid="3f683f6b-19f6-49dd-9ee1-787b216aaa2f"/>
<textElement textAlignment="Center">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Actual Shipping]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="21" splitType="Stretch">
<textField isBlankWhenNull="true">
<reportElement x="0" y="0" width="140" height="20" isRemoveLineWhenBlank="true" uuid="fdd69c30-9da5-4bd2-a7b8-44a506e2d7ff"/>
<textFieldExpression><![CDATA[$F{CUSTOMER_NAME}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true" hyperlinkType="Reference">
<reportElement x="140" y="0" width="75" height="20" isRemoveLineWhenBlank="true" forecolor="#000099" uuid="19db6cb8-af37-46e6-9227-f1b55fc49f22"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{SO_NUM}]]></textFieldExpression>
<anchorNameExpression><![CDATA["SONum"]]></anchorNameExpression>
<hyperlinkReferenceExpression><![CDATA[$F{SO_NUM}]]></hyperlinkReferenceExpression>
</textField>
<textField pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="335" y="0" width="120" height="20" isRemoveLineWhenBlank="true" uuid="006475e5-d36f-4482-97cf-2c2eda2d5a66"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$F{SHIPCARTON_FREIGHTAMOUNT}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00" isBlankWhenNull="true">
<reportElement x="215" y="0" width="120" height="20" isRemoveLineWhenBlank="true" uuid="376d9c76-1d96-48ea-ac4a-40770ba28867"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$V{estimatedShipping}]]></textFieldExpression>
</textField>
<textField pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
<reportElement x="455" y="0" width="100" height="20" isRemoveLineWhenBlank="true" uuid="c236c087-e6f4-4de6-a3d6-8abb8b798346"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$V{shipPriceDif}]]></textFieldExpression>
</textField>
</band>
</detail>
<pageFooter>
<band height="22" splitType="Stretch">
<textField>
<reportElement x="435" y="0" width="80" height="20" uuid="64e6c2aa-58eb-4994-83c3-16cb70197fef"/>
<textElement textAlignment="Right"/>
<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
</textField>
<textField evaluationTime="Report">
<reportElement x="515" y="0" width="40" height="20" uuid="09e2e08b-c9b1-4a5b-95fd-1c0a0dba17a2"/>
<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
</textField>
</band>
</pageFooter>
<summary>
<band height="22" splitType="Stretch">
<textField pattern="#,##0.00;-#,##0.00">
<reportElement x="150" y="1" width="75" height="20" uuid="8ab3526d-e89e-4043-86dd-52d89a2b7b21"/>
<textElement verticalAlignment="Top">
<font size="12" isBold="true"/>
</textElement>
<textFieldExpression><![CDATA[$V{totalShipPriceDif}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="140" y="1" width="10" height="20" uuid="110043fb-4dde-414e-b07f-f79cbb8839ab"/>
<textElement textAlignment="Right">
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[$]]></text>
</staticText>
<line>
<reportElement x="0" y="0" width="555" height="1" uuid="e81602ee-7eab-43f3-90c1-cf69086623a9"/>
</line>
<staticText>
<reportElement x="0" y="1" width="140" height="20" uuid="095559e8-33e4-4a1a-9537-f8dff2b533d6"/>
<textElement>
<font size="12" isBold="true"/>
</textElement>
<text><![CDATA[Total Cost Difference :]]></text>
</staticText>
</band>
</summary>
</jasperReport>
Your problem is that the $V{estimatedShipping} is evaluated after your variable $V{shipPriceDif} since its after in your variable definition, or move it above or dump it...
Just calculate the Difference in the textField
<textField pattern="#,##0.00;-#,##0.00" isBlankWhenNull="true">
<reportElement x="455" y="0" width="100" height="20" isRemoveLineWhenBlank="true" uuid="c236c087-e6f4-4de6-a3d6-8abb8b798346"/>
<textElement textAlignment="Center"/>
<textFieldExpression><![CDATA[$V{estimatedShipping}.doubleValue()-$F{SHIPCARTON_FREIGHTAMOUNT}.doubleValue()]]></textFieldExpression>
</textField>
The output of this would be:
+-------+-----------+--------+------------+
| SO# | Estimated | Actual | Difference |
+-------+-----------+--------+------------+
| 46137 | 700 | 58,38 | 641,62 |
| 46137 | 0 | 57,12 | -57.12 |
| 46137 | 0 | 28,29 | -28,29 |
| 46148 | 0,85 | 267,32 | -266,47 |
+-------+-----------+--------+------------+
I have a requirement where I need to display a section of data surrounded by borders, like this:
I have tried to do it with adding Rectangle component in the Background band. In the internal preview window and PDF preview it is displayed as above, but when I run it in the server or use HTML preview, the border disappears. I have also tried to insert the Rectangle component in the Detail band and using Frames instead of a Rectangle, surrounding the data, but with the same problem.
I am using iReport 5.0.1 with compatibility set to JasperReports 3.5.1.
Here is my 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="Payslip" pageWidth="1000" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="960" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<import value="org.joda.time.DateTime"/>
<style name="Headings" vAlign="Middle" lineSpacing="1_1_2" fontName="Arial" fontSize="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
<style name="Data" isDefault="true" vAlign="Middle" lineSpacing="1_1_2" fontName="Arial" fontSize="11"/>
<parameter name="rptName" class="java.lang.String" isForPrompting="false"/>
<parameter name="company" class="java.lang.String"/>
<field name="empName" class="java.lang.String"/>
<field name="salaryMonthName" class="java.lang.String"/>
<field name="salaryMonthYear" class="java.lang.Integer"/>
<field name="employeeCode" class="java.lang.String"/>
<field name="designation" class="java.lang.String"/>
<field name="grade" class="java.lang.String"/>
<field name="location" class="java.lang.String"/>
<field name="department" class="java.lang.String"/>
<field name="branch" class="java.lang.String"/>
<field name="dateOfJoining" class="org.joda.time.DateTime"/>
<field name="pfNumber" class="java.lang.String"/>
<field name="panNumber" class="java.lang.String"/>
<field name="bankName" class="java.lang.String"/>
<field name="accountNumber" class="java.lang.String"/>
<field name="workingDays" class="java.lang.Double"/>
<field name="paidDays" class="java.lang.Double"/>
<field name="absentDays" class="java.lang.Double"/>
<background>
<band height="301">
<rectangle>
<reportElement mode="Transparent" x="0" y="120" width="324" height="165"/>
<graphicElement>
<pen lineWidth="2.0"/>
</graphicElement>
</rectangle>
<rectangle>
<reportElement mode="Transparent" x="324" y="120" width="320" height="165"/>
<graphicElement>
<pen lineWidth="2.0"/>
</graphicElement>
</rectangle>
</band>
</background>
<title>
<band height="102">
<line>
<reportElement x="0" y="43" width="265" height="1" forecolor="#3333FF"/>
<graphicElement>
<pen lineWidth="3.0"/>
</graphicElement>
</line>
<textField isStretchWithOverflow="true">
<reportElement x="0" y="0" width="405" height="32" forecolor="#3333FF"/>
<textElement lineSpacing="Single">
<font size="16" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{company}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="0" y="44" width="200" height="31" forecolor="#3333FF"/>
<textElement lineSpacing="Single">
<font fontName="Arial" size="18"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$P{rptName}]]></textFieldExpression>
</textField>
<textField pattern="EEE, d MMM yyyy HH:mm">
<reportElement mode="Opaque" x="843" y="71" width="117" height="20" forecolor="#FFFFFF" backcolor="#999999"/>
<textElement lineSpacing="Single">
<font fontName="Arial"/>
</textElement>
<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
</textField>
<textField>
<reportElement x="92" y="82" width="129" height="20"/>
<textElement lineSpacing="Single">
<font size="14" isBold="true"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{salaryMonthName} + " " + $F{salaryMonthYear}]]></textFieldExpression>
</textField>
<staticText>
<reportElement x="0" y="82" width="92" height="20"/>
<textElement lineSpacing="Single">
<font size="14" isBold="true"/>
</textElement>
<text><![CDATA[For Month]]></text>
</staticText>
</band>
</title>
<detail>
<band height="205">
<staticText>
<reportElement style="Headings" x="12" y="23" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Code]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="43" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Name]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="63" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Designation]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="83" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Grade]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="103" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Location]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="123" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Department]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="143" width="91" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Branch]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="12" y="163" width="92" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Date of Joining]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="23" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[P. F. Number]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="43" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[PAN No.]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="63" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Pay Mode / Bank Name]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="83" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[A/C No.]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="103" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Working Days]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="123" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Paid Days]]></text>
</staticText>
<staticText>
<reportElement style="Headings" x="341" y="143" width="98" height="20"/>
<textElement lineSpacing="1_1_2"/>
<text><![CDATA[Absent Days]]></text>
</staticText>
<textField>
<reportElement x="154" y="23" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{employeeCode}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="43" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{empName}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="63" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{designation}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="83" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{grade}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="103" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{location}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="123" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{department}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="143" width="140" height="20"/>
<textElement lineSpacing="Single"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{branch}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="23" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{pfNumber}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="43" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{panNumber}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="63" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{bankName}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="83" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{accountNumber}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="103" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.Double"><![CDATA[$F{workingDays}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="123" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.Double"><![CDATA[$F{paidDays}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="492" y="143" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.Double"><![CDATA[$F{absentDays}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="154" y="163" width="140" height="20"/>
<textElement lineSpacing="1_1_2"/>
<textFieldExpression class="java.lang.String"><![CDATA[$F{dateOfJoining}.toString("dd-MMM-yyyy")]]></textFieldExpression>
</textField>
<break>
<reportElement x="0" y="184" width="960" height="1"/>
</break>
</band>
</detail>
</jasperReport>
The problem that you are having may be due to the fact that you cannot have objects overlapping in HTML. I have had this issue with Jasper before. If two objects (or more) overlap, only one of them will show on the report.
You could try using separate lines that do not overlap any of the other objects.
I have had trouble getting that to work so the way I have dealt with the situation in cases like yours is to use the borders of the text fields to make up the rectangles. For the top left label (Code), you can use it's top and left borders. For the middle labels, the left border. And for the bottom field (Date of Joining), the bottom and left borders. Then the opposite for the text fields. Then you can use padding on your text fields to make them look right. Sometimes I have a padding of 20 or more to get the effect I'm looking for.
I hope this helps.