Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8475411
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T17:53:07+00:00 2026-06-10T17:53:07+00:00

I am designing an invoice using iReport but i am having a problem with

  • 0

I am designing an invoice using iReport but i am having a problem with formatting.

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.

This is format of letter head:

enter image description here

At the bottom there is a field where total amount has to get printed, but i am not able to do so.

My output using iReport:

Screen Shot of iReport

enter image description here

enter image description here

This 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="LetterHeadInvoice" language="groovy" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
    <parameter name="COMPANY_ADDRESS" class="java.lang.String">
        <defaultValueExpression><![CDATA[]]></defaultValueExpression>
    </parameter>
    <parameter name="COMPANY_NAME" class="java.lang.String">
        <defaultValueExpression><![CDATA[]]></defaultValueExpression>
    </parameter>
    <parameter name="INVOICENO" class="java.lang.String">
        <defaultValueExpression><![CDATA[]]></defaultValueExpression>
    </parameter>
    <queryString>
        <![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})]]>
    </queryString>
    <field name="docketno" class="java.lang.String"/>
    <field name="bookingdate" class="java.sql.Timestamp"/>
    <field name="rname" class="java.lang.String"/>
    <field name="rcity" class="java.lang.String"/>
    <field name="rcountry" class="java.lang.String"/>
    <field name="noofitems" class="java.lang.Integer"/>
    <field name="actualweight" class="java.math.BigDecimal"/>
    <field name="volweight" class="java.lang.Short"/>
    <field name="docketcharges" class="java.lang.Integer"/>
    <field name="weightused" class="java.lang.Integer"/>
    <field name="total" class="java.lang.Integer"/>
    <field name="type" class="java.lang.String"/>
    <field name="sname" class="java.lang.String"/>
    <field name="scity" class="java.lang.String"/>
    <field name="scountry" class="java.lang.String"/>
    <field name="fovtype" class="java.lang.String"/>
    <field name="fovamount" class="java.lang.String"/>
    <field name="oditype" class="java.lang.String"/>
    <field name="odiamount" class="java.lang.String"/>
    <field name="nformtype" class="java.lang.String"/>
    <field name="nformamount" class="java.lang.String"/>
    <field name="fsetype" class="java.lang.String"/>
    <field name="fseamount" class="java.lang.Integer"/>
    <variable name="TOTAL" class="java.lang.Double" calculation="Sum">
        <variableExpression><![CDATA[$F{total}]]></variableExpression>
    </variable>
    <variable name="TOTAL2" class="java.lang.Double" incrementType="Column" calculation="Sum">
        <variableExpression><![CDATA[$V{TOTAL}+$F{fseamount}]]></variableExpression>
    </variable>
    <variable name="Tax" class="java.lang.Double">
        <variableExpression><![CDATA[$V{TOTAL2}/100.00*12.36]]></variableExpression>
    </variable>
    <background>
        <band height="802" splitType="Stretch">
            <image>
                <reportElement x="0" y="0" width="555" height="802"/>
                <imageExpression><![CDATA["C:\\Documents and Settings\\Hemant\\Desktop\\RNZImage.jpg"]]></imageExpression>
            </image>
        </band>
    </background>
    <title>
        <band height="205" splitType="Stretch">
            <staticText>
                <reportElement x="40" y="61" width="40" height="23"/>
                <textElement>
                    <font fontName="Lucida Bright" size="12" isBold="true"/>
                </textElement>
                <text><![CDATA[Bill To]]></text>
            </staticText>
            <textField>
                <reportElement x="40" y="84" width="266" height="107"/>
                <textElement>
                    <font size="11"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{sname}+"\n"+$F{scity}+","+$F{scountry}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="324" y="95" width="91" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$P{INVOICENO}]]></textFieldExpression>
            </textField>
            <textField pattern="dd/MM/yyyy">
                <reportElement x="429" y="96" width="104" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
            </textField>
            <textField pattern="MMMMM-yy">
                <reportElement x="312" y="145" width="83" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
            </textField>
        </band>
    </title>
    <detail>
        <band height="112" splitType="Stretch">
            <textField pattern="MM/dd/yyyy">
                <reportElement x="28" y="31" width="52" height="20"/>
                <textElement>
                    <font size="9"/>
                </textElement>
                <textFieldExpression><![CDATA[$F{bookingdate}.toString().substring(0,$F{bookingdate}.toString().indexOf(" "))]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="82" y="31" width="54" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{docketno}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="164" y="31" width="77" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{rcity}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="261" y="31" width="35" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{rcity}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="306" y="31" width="33" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{noofitems}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="345" y="31" width="33" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{weightused}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="395" y="31" width="73" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{type}]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="480" y="31" width="48" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$F{docketcharges}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="346" y="90" width="123" height="17" isRemoveLineWhenBlank="true">
                    <printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
                </reportElement>
                <textElement/>
                <textFieldExpression><![CDATA[$F{oditype}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="480" y="90" width="55" height="17" isRemoveLineWhenBlank="true">
                    <printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
                </reportElement>
                <textElement/>
                <textFieldExpression><![CDATA[$F{odiamount}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="346" y="56" width="123" height="17" isRemoveLineWhenBlank="true">
                    <printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
                </reportElement>
                <textElement/>
                <textFieldExpression><![CDATA[$F{fovtype}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="480" y="73" width="55" height="17" isRemoveLineWhenBlank="true">
                    <printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
                </reportElement>
                <textElement/>
                <textFieldExpression><![CDATA[$F{nformamount}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="346" y="73" width="123" height="17" isRemoveLineWhenBlank="true">
                    <printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
                </reportElement>
                <textElement/>
                <textFieldExpression><![CDATA[$F{nformtype}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="480" y="56" width="55" height="17" isRemoveLineWhenBlank="true">
                    <printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
                </reportElement>
                <textElement/>
                <textFieldExpression><![CDATA[$F{fovamount}]]></textFieldExpression>
            </textField>
        </band>
    </detail>
    <summary>
        <band height="280" splitType="Stretch">
            <textField>
                <reportElement x="478" y="12" width="59" height="20"/>
                <textElement markup="none"/>
                <textFieldExpression><![CDATA[$V{TOTAL}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="334" y="32" width="128" height="17">
                    <printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
                </reportElement>
                <textElement/>
                <textFieldExpression><![CDATA[$F{fsetype}]]></textFieldExpression>
            </textField>
            <textField isBlankWhenNull="true">
                <reportElement x="478" y="32" width="59" height="17">
                    <printWhenExpression><![CDATA[$F{odiamount} != null && $F{odiamount}.trim().length()>0]]></printWhenExpression>
                </reportElement>
                <textElement/>
                <textFieldExpression><![CDATA[$F{fseamount}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="334" y="49" width="128" height="20"/>
                <textElement/>
                <text><![CDATA[TOTAL]]></text>
            </staticText>
            <staticText>
                <reportElement x="334" y="12" width="128" height="20"/>
                <textElement/>
                <text><![CDATA[SUB TOTAL]]></text>
            </staticText>
            <textField pattern="###0.00">
                <reportElement x="478" y="69" width="59" height="20"/>
                <textElement/>
                <textFieldExpression><![CDATA[$V{TOTAL2}/100.00*12.36]]></textFieldExpression>
            </textField>
            <textField>
                <reportElement x="478" y="49" width="59" height="20"/>
                <textElement markup="none"/>
                <textFieldExpression><![CDATA[$V{TOTAL}+$F{fseamount}]]></textFieldExpression>
            </textField>
            <staticText>
                <reportElement x="334" y="69" width="128" height="20"/>
                <textElement/>
                <text><![CDATA[Service Tax At 12.36%]]></text>
            </staticText>
            <textField pattern="###0.00">
                <reportElement x="464" y="252" width="73" height="20"/>
                <textElement>
                    <font size="11" isBold="true"/>
                </textElement>
                <textFieldExpression><![CDATA[$V{TOTAL2}+$V{Tax}]]></textFieldExpression>
            </textField>
        </band>
    </summary>
</jasperReport>
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-10T17:53:09+00:00Added an answer on June 10, 2026 at 5:53 pm

    You should try to change Position Type to Fix Relative to Bottom or Float for this textField (with $V{TOTAL2}+$V{Tax} expression).

    <textField pattern="###0.00">
        <reportElement positionType="FixRelativeToBottom" x="464" y="252" width="73" height="20"/>
        <textElement>
            <font size="11" isBold="true"/>
        </textElement>
        <textFieldExpression><![CDATA[$V{TOTAL2}+$V{Tax}]]></textFieldExpression>
    </textField>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have a database I'm working on designing using Access 2007 and I'm wondering
Im designing a dialerPad form using Windows form, there is a textbox which should
Designing an interface with QT4 I have been advised that using multiple Tabs at
Designing forms has always been fun, but getting them to send email on the
When designing a C API for configuring a library/utility, I have a co-worker who
while designing my user control, i encountered the following problem: i would like to
When designing a form I have the option of putting a close button at
When designing an distributed application in Java there seem to be a few technologies
When designing a client/server architecture, is there any advantage to multiplexing multiple connections from
When designing both the domain-model and class-diagrams I am having some trouble understanding what

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.