Jump to content
We've recently updated our Privacy Statement, available here ×

In group footer iam trying to take difference between 2 summed variables but its giving wrong difference value ....anybody have any idea on this


sushmagoravar94

Recommended Posts

<?xml version="1.0" encoding="UTF-8"?>
<!-- Created with Jaspersoft Studio version 6.12.2.final using JasperReports Library version 6.12.2-75c5e90a222ab406e416cbf590a5397028a52de3  -->
<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="Finance Balance Sheet" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="74598a13-7f9a-4117-90e1-f2d9698f23a9">
    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Bar chart Data source"/>
    <queryString language="json">
        <![CDATA[object.individual_ldgrLedger]]>
    </queryString>
    <field name="individual_ldgrLedger_ldgrYear" class="java.lang.Integer">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrYear"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrYear]]></fieldDescription>
    </field>
    <field name="individual_ldgrLedger_ldgrAmount" class="java.lang.String">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrAmount"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrAmount]]></fieldDescription>
    </field>
    <field name="individual_ldgrLedger_ldgrPostingKey" class="java.lang.String">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrPostingKey"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrPostingKey]]></fieldDescription>
    </field>
    <field name="individual_ldgrLedger_ldgrAmountCr" class="java.math.BigDecimal">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrAmountCr"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrAmountCr]]></fieldDescription>
    </field>
    <field name="individual_ldgrLedger_ldgrAmountDr" class="java.math.BigDecimal">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrAmountDr"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrAmountDr]]></fieldDescription>
    </field>
    <field name="individual_ldgrLedger_ldgrControlAccount" class="java.lang.String">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrControlAccount"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrControlAccount]]></fieldDescription>
    </field>
    <field name="individual_ldgrLedger_ldgrTransactionId" class="java.lang.Integer">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrTransactionId"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrTransactionId]]></fieldDescription>
    </field>
    <field name="individual_ldgrLedger_ldgrGlName" class="java.lang.String">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrGlName"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrGlName]]></fieldDescription>
    </field>
    <field name="individual_ldgrLedger_ldgrBalance" class="java.lang.String">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrBalance"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrBalance]]></fieldDescription>
    </field>
    <field name="individual_ldgrLedger_ldgrAccountType" class="java.lang.String">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrAccountType"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrAccountType]]></fieldDescription>
    </field>
    <field name="individual_ldgrLedger_ldgrAccountGroup" class="java.lang.String">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrAccountGroup"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrAccountGroup]]></fieldDescription>
    </field>
    <field name="individual_ldgrLedger_ldgrGlNumber" class="java.lang.String">
        <property name="net.sf.jasperreports.json.field.expression" value="individual_ldgrLedger_ldgrGlNumber"/>
        <fieldDescription><![CDATA[individual_ldgrLedger_ldgrGlNumber]]></fieldDescription>
    </field>
    <variable name="Amount" class="java.math.BigDecimal" calculation="Sum">
        <variableExpression><![CDATA[$V{DrAmount}.compareTo($V{CrAmmont})==1?$V{DrAmount}.subtract( $V{CrAmmont},new MathContext(2)):$V{CrAmmont}.subtract( $V{DrAmount} ,new MathContext(2))]]></variableExpression>
        <initialValueExpression><![CDATA[new BigDecimal("0")]]></initialValueExpression>
    </variable>
    <variable name="CrAmmont" class="java.math.BigDecimal" resetType="Group" resetGroup="Account Group" calculation="Sum">
        <variableExpression><![CDATA[$F{individual_ldgrLedger_ldgrAmountCr}!=null?$F{individual_ldgrLedger_ldgrAmountCr}:new BigDecimal("0")]]></variableExpression>
        <initialValueExpression><![CDATA[new BigDecimal("0")]]></initialValueExpression>
    </variable>
    <variable name="DrAmount" class="java.math.BigDecimal" resetType="Group" resetGroup="Account Group" calculation="Sum">
        <variableExpression><![CDATA[$F{individual_ldgrLedger_ldgrAmountDr}!=null?$F{individual_ldgrLedger_ldgrAmountDr}:new BigDecimal("0")]]></variableExpression>
        <initialValueExpression><![CDATA[new BigDecimal("0")]]></initialValueExpression>
    </variable>
    <group name="Account Group">
        <groupExpression><![CDATA[$F{individual_ldgrLedger_ldgrAccountGroup}.concat( $F{individual_ldgrLedger_ldgrControlAccount} )]]></groupExpression>
        <groupHeader>
            <band height="40">
                <textField>
                    <reportElement mode="Opaque" x="0" y="0" width="100" height="30" forecolor="#090D01" backcolor="#B6E6B1" uuid="3ff152c8-cabe-4c31-a361-75b04deaf442"/>
                    <textFieldExpression><![CDATA[$F{individual_ldgrLedger_ldgrAccountGroup}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="130" y="0" width="100" height="30" uuid="a034c471-3d80-4469-a0cf-5f986eac5cbb"/>
                    <textFieldExpression><![CDATA[$F{individual_ldgrLedger_ldgrControlAccount}]]></textFieldExpression>
                </textField>
            </band>
        </groupHeader>
    </group>
    <group name="CrDr">
        <groupExpression><![CDATA[$F{individual_ldgrLedger_ldgrAccountGroup}.concat( $F{individual_ldgrLedger_ldgrControlAccount} )]]></groupExpression>
        <groupFooter>
            <band height="112">
                <textField>
                    <reportElement x="10" y="50" width="100" height="30" uuid="10714a07-2bdb-428a-b750-8041d701b3d7"/>
                    <textFieldExpression><![CDATA[$V{Amount}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="210" y="50" width="100" height="30" uuid="1949821f-d3f7-410e-ad9e-ada2c02b0119"/>
                    <textFieldExpression><![CDATA[$V{CrAmmont}]]></textFieldExpression>
                </textField>
                <textField>
                    <reportElement x="400" y="50" width="100" height="30" uuid="70fe8dcd-3cc0-43e7-8b88-f328f9d63bfc"/>
                    <textFieldExpression><![CDATA[$V{DrAmount}]]></textFieldExpression>
                </textField>
                <staticText>
                    <reportElement x="420" y="12" width="60" height="18" uuid="9a305dba-2793-4637-93a5-da0b52e5e27e">
                        <property name="com.jaspersoft.studio.unit.height" value="px"/>
                        <property name="com.jaspersoft.studio.unit.width" value="px"/>
                        <property name="com.jaspersoft.studio.unit.y" value="px"/>
                    </reportElement>
                    <textElement verticalAlignment="Middle">
                        <font isBold="true"/>
                    </textElement>
                    <text><![CDATA[Debit]]></text>
                </staticText>
                <staticText>
                    <reportElement x="220" y="12" width="60" height="18" uuid="ac3f1ea1-bde7-4b87-841f-800112cc10d9">
                        <property name="com.jaspersoft.studio.unit.height" value="px"/>
                        <property name="com.jaspersoft.studio.unit.width" value="px"/>
                        <property name="com.jaspersoft.studio.unit.y" value="px"/>
                    </reportElement>
                    <textElement verticalAlignment="Middle">
                        <font isBold="true"/>
                    </textElement>
                    <text><![CDATA[Credit]]></text>
                </staticText>
                <staticText>
                    <reportElement x="20" y="12" width="80" height="18" uuid="88f0ad58-826e-4237-bf4d-8de1a17901d6">
                        <property name="com.jaspersoft.studio.unit.height" value="px"/>
                        <property name="com.jaspersoft.studio.unit.width" value="px"/>
                        <property name="com.jaspersoft.studio.unit.y" value="px"/>
                    </reportElement>
                    <textElement verticalAlignment="Middle">
                        <font isBold="true"/>
                    </textElement>
                    <text><![CDATA[Difference]]></text>
                </staticText>
            </band>
        </groupFooter>
    </group>
    <background>
        <band splitType="Stretch"/>
    </background>
    <title>
        <band height="52" splitType="Stretch">
            <staticText>
                <reportElement x="180" y="0" width="200" height="30" uuid="88452f26-bb3b-4ee9-85d7-13c36a492c30"/>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="16" isBold="true"/>
                </textElement>
                <text><![CDATA[balance Sheet]]></text>
            </staticText>
            <staticText>
                <reportElement x="0" y="32" width="280" height="20" uuid="0a3428ce-b19d-4b38-b4b8-bc4e337a73e4">
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                    <property name="com.jaspersoft.studio.unit.x" value="px"/>
                </reportElement>
                <box>
                    <pen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Center">
                    <font size="14" isBold="true"/>
                </textElement>
                <text><![CDATA[Liabilities]]></text>
            </staticText>
            <staticText>
                <reportElement x="280" y="32" width="290" height="20" uuid="04fe2512-dfa3-4e76-82eb-6063385df6b6">
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                    <property name="com.jaspersoft.studio.unit.x" value="px"/>
                </reportElement>
                <box>
                    <pen lineWidth="1.0"/>
                </box>
                <textElement textAlignment="Center" verticalAlignment="Middle">
                    <font size="14" isBold="true"/>
                </textElement>
                <text><![CDATA[Assets]]></text>
            </staticText>
        </band>
    </title>
    <pageHeader>
        <band height="18" splitType="Stretch">
            <staticText>
                <reportElement x="0" y="0" width="80" height="18" uuid="779c929f-29cf-4fd5-9bb3-83a90657b79b">
                    <property name="com.jaspersoft.studio.unit.height" value="px"/>
                    <property name="com.jaspersoft.studio.unit.width" value="px"/>
                    <property name="com.jaspersoft.studio.unit.y" value="px"/>
                </reportElement>
                <textElement verticalAlignment="Middle">
                    <font isBold="true"/>
                </textElement>
                <text><![CDATA[GL Number
]]></text>
            </staticText>
        </band>
    </pageHeader>
    <summary>
        <band height="50"/>
    </summary>
</jasperReport>
 

Link to comment
Share on other sites

  • Replies 1
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...