title: Report designing issue using iReport
body: <p>I am designing an invoice using <em>iReport</em> but i am having a problem with formatting.</p>
  
  <p>I have to print invoice on letter head, where there are fixed positions to print the fields for example the total Amount has to get printed inside the box fixed at some location.</p>
  
  <p>This is format of letter head:</p>
  
  <p><img src="https://i.stack.imgur.com/9w8Ga.jpg" alt="enter image description here"></p>
  
  <p>At the bottom there is a field where total amount has to get printed, but i am not able to do so.</p>
  
  <p>My output using <em>iReport</em>:</p>
  
  <p>Screen Shot of iReport</p>
  
  <p><img src="https://i.stack.imgur.com/MDsiM.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/ig3cx.jpg" alt="enter image description here"></p>
  
  <p>This is my jrxml file:</p>
  
  <pre class="lang-xml prettyprint-override"><code>&lt;?xml version="1.0" encoding="UTF-8"?&gt;
  &lt;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="LetterHeadInvoice" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20"&gt;
      &lt;parameter name="COMPANY_ADDRESS" class="java.lang.String"&gt;
          &lt;defaultValueExpression&gt;&lt;![CDATA[]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;parameter name="COMPANY_NAME" class="java.lang.String"&gt;
          &lt;defaultValueExpression&gt;&lt;![CDATA[]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;parameter name="INVOICENO" class="java.lang.String"&gt;
          &lt;defaultValueExpression&gt;&lt;![CDATA[]]&gt;&lt;/defaultValueExpression&gt;
      &lt;/parameter&gt;
      &lt;queryString&gt;
          &lt;![CDATA[SELECT DISTINCT c.docketno,c.bookingdate,c.rname,c.rcity,c.rcountry
         ,c.noofitems,c.actualweight,c.volweight,p.docketcharges,p.weight as weightused,
         p.total,i.type,c.sname,c.scity,c.scountry,c.bookingdate,s.fovtype ,s.fovamount,s.oditype ,s.odiamount,s.nformtype ,s.nformamount,o.fsetype,o.fseamount
   FROM  typedetails i,paymentdetails p,clientdetails c,subdetails s,otherdetails o
   WHERE i.id=c.typeid
   AND   c.docketno=p.docketno
  And c.docketno= s.docketno
  And c.docketno= o.docketno
    AND   c.docketno IN (SELECT docketnumber FROM invoice  WHERE InvoiceId=$P{INVOICENO})]]&gt;
      &lt;/queryString&gt;
      &lt;field name="docketno" class="java.lang.String"/&gt;
      &lt;field name="bookingdate" class="java.sql.Timestamp"/&gt;
      &lt;field name="rname" class="java.lang.String"/&gt;
      &lt;field name="rcity" class="java.lang.String"/&gt;
      &lt;field name="rcountry" class="java.lang.String"/&gt;
      &lt;field name="noofitems" class="java.lang.Integer"/&gt;
      &lt;field name="actualweight" class="java.math.BigDecimal"/&gt;
      &lt;field name="volweight" class="java.lang.Short"/&gt;
      &lt;field name="docketcharges" class="java.lang.Integer"/&gt;
      &lt;field name="weightused" class="java.lang.Integer"/&gt;
      &lt;field name="total" class="java.lang.Integer"/&gt;
      &lt;field name="type" class="java.lang.String"/&gt;
      &lt;field name="sname" class="java.lang.String"/&gt;
      &lt;field name="scity" class="java.lang.String"/&gt;
      &lt;field name="scountry" class="java.lang.String"/&gt;
      &lt;field name="fovtype" class="java.lang.String"/&gt;
      &lt;field name="fovamount" class="java.lang.String"/&gt;
      &lt;field name="oditype" class="java.lang.String"/&gt;
      &lt;field name="odiamount" class="java.lang.String"/&gt;
      &lt;field name="nformtype" class="java.lang.String"/&gt;
      &lt;field name="nformamount" class="java.lang.String"/&gt;
      &lt;field name="fsetype" class="java.lang.String"/&gt;
      &lt;field name="fseamount" class="java.lang.Integer"/&gt;
      &lt;variable name="TOTAL" class="java.lang.Double" calculation="Sum"&gt;
          &lt;variableExpression&gt;&lt;![CDATA[$F{total}]]&gt;&lt;/variableExpression&gt;
      &lt;/variable&gt;
      &lt;variable name="TOTAL2" class="java.lang.Double" incrementType="Column" calculation="Sum"&gt;
          &lt;variableExpression&gt;&lt;![CDATA[$V{TOTAL}+$F{fseamount}]]&gt;&lt;/variableExpression&gt;
      &lt;/variable&gt;
      &lt;variable name="Tax" class="java.lang.Double"&gt;
          &lt;variableExpression&gt;&lt;![CDATA[$V{TOTAL2}/100.00*12.36]]&gt;&lt;/variableExpression&gt;
      &lt;/variable&gt;
      &lt;background&gt;
          &lt;band height="802" splitType="Stretch"&gt;
              &lt;image&gt;
                  &lt;reportElement x="0" y="0" width="555" height="802"/&gt;
                  &lt;imageExpression&gt;&lt;![CDATA["C:\\Documents and Settings\\Hemant\\Desktop\\RNZImage.jpg"]]&gt;&lt;/imageExpression&gt;
              &lt;/image&gt;
          &lt;/band&gt;
      &lt;/background&gt;
      &lt;title&gt;
          &lt;band height="205" splitType="Stretch"&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="40" y="61" width="40" height="23"/&gt;
                  &lt;textElement&gt;
                      &lt;font fontName="Lucida Bright" size="12" isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;text&gt;&lt;![CDATA[Bill To]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;textField&gt;
                  &lt;reportElement x="40" y="84" width="266" height="107"/&gt;
                  &lt;textElement&gt;
                      &lt;font size="11"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{sname}+"\n"+$F{scity}+","+$F{scountry}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="324" y="95" width="91" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$P{INVOICENO}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField pattern="dd/MM/yyyy"&gt;
                  &lt;reportElement x="429" y="96" width="104" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[new java.util.Date()]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField pattern="MMMMM-yy"&gt;
                  &lt;reportElement x="312" y="145" width="83" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[new java.util.Date()]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
          &lt;/band&gt;
      &lt;/title&gt;
      &lt;detail&gt;
          &lt;band height="112" splitType="Stretch"&gt;
              &lt;textField pattern="MM/dd/yyyy"&gt;
                  &lt;reportElement x="28" y="31" width="52" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font size="9"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{bookingdate}.toString().substring(0,$F{bookingdate}.toString().indexOf(" "))]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="82" y="31" width="54" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{docketno}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="164" y="31" width="77" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{rcity}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="261" y="31" width="35" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{rcity}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="306" y="31" width="33" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{noofitems}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="345" y="31" width="33" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{weightused}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="395" y="31" width="73" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{type}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="480" y="31" width="48" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{docketcharges}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement x="346" y="90" width="123" height="17" isRemoveLineWhenBlank="true"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{odiamount} != null &amp;&amp; $F{odiamount}.trim().length()&gt;0]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{oditype}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement x="480" y="90" width="55" height="17" isRemoveLineWhenBlank="true"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{odiamount} != null &amp;&amp; $F{odiamount}.trim().length()&gt;0]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{odiamount}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement x="346" y="56" width="123" height="17" isRemoveLineWhenBlank="true"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{odiamount} != null &amp;&amp; $F{odiamount}.trim().length()&gt;0]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{fovtype}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement x="480" y="73" width="55" height="17" isRemoveLineWhenBlank="true"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{odiamount} != null &amp;&amp; $F{odiamount}.trim().length()&gt;0]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{nformamount}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement x="346" y="73" width="123" height="17" isRemoveLineWhenBlank="true"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{odiamount} != null &amp;&amp; $F{odiamount}.trim().length()&gt;0]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{nformtype}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement x="480" y="56" width="55" height="17" isRemoveLineWhenBlank="true"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{odiamount} != null &amp;&amp; $F{odiamount}.trim().length()&gt;0]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{fovamount}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
          &lt;/band&gt;
      &lt;/detail&gt;
      &lt;summary&gt;
          &lt;band height="280" splitType="Stretch"&gt;
              &lt;textField&gt;
                  &lt;reportElement x="478" y="12" width="59" height="20"/&gt;
                  &lt;textElement markup="none"/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$V{TOTAL}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement x="334" y="32" width="128" height="17"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{odiamount} != null &amp;&amp; $F{odiamount}.trim().length()&gt;0]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{fsetype}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField isBlankWhenNull="true"&gt;
                  &lt;reportElement x="478" y="32" width="59" height="17"&gt;
                      &lt;printWhenExpression&gt;&lt;![CDATA[$F{odiamount} != null &amp;&amp; $F{odiamount}.trim().length()&gt;0]]&gt;&lt;/printWhenExpression&gt;
                  &lt;/reportElement&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$F{fseamount}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="334" y="49" width="128" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[TOTAL]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="334" y="12" width="128" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[SUB TOTAL]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;textField pattern="###0.00"&gt;
                  &lt;reportElement x="478" y="69" width="59" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$V{TOTAL2}/100.00*12.36]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;textField&gt;
                  &lt;reportElement x="478" y="49" width="59" height="20"/&gt;
                  &lt;textElement markup="none"/&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$V{TOTAL}+$F{fseamount}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
              &lt;staticText&gt;
                  &lt;reportElement x="334" y="69" width="128" height="20"/&gt;
                  &lt;textElement/&gt;
                  &lt;text&gt;&lt;![CDATA[Service Tax At 12.36%]]&gt;&lt;/text&gt;
              &lt;/staticText&gt;
              &lt;textField pattern="###0.00"&gt;
                  &lt;reportElement x="464" y="252" width="73" height="20"/&gt;
                  &lt;textElement&gt;
                      &lt;font size="11" isBold="true"/&gt;
                  &lt;/textElement&gt;
                  &lt;textFieldExpression&gt;&lt;![CDATA[$V{TOTAL2}+$V{Tax}]]&gt;&lt;/textFieldExpression&gt;
              &lt;/textField&gt;
          &lt;/band&gt;
      &lt;/summary&gt;
  &lt;/jasperReport&gt;
  </code></pre>