Jump to content
Changes to the Jaspersoft community edition download ×

Report total is null


perlnecklace

Recommended Posts

I have been staring at this report for the past 2 days and looking all over the internet for a solutiuon and i have lost track on how many different things I have tried.

I am using Jaspersoft Studio ver 6.3.1

I have a report with 2 subreports.

There are cetain parameters passed to the subreports in order for them to produce certain values from a seperate database.  The results of the calculations in the subreports is returned to the main report.  In the details section of the main report various calulatins are performed.  I need to add up the calculations and produca a total. Irrespective of what I the result for "FTE Male Total" appears as a null

My main report is

<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.3.1.final using JasperReports Library version 6.3.1  --><!-- 2017-08-29T15:46:53 --><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="DHET Report" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="802" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="028b3521-0fca-424c-b089-a50d58e75681">    <property name="com.jaspersoft.studio.data.sql.tables" value="cmVwb3J0aW5nLm1vZHVsZXMgLDE1LDgwLGFiNjdkZTcwLTAyM2YtNGMxMi04YmRkLTI3MjRlOWE4
YWE1ZTtyZXBvcnRpbmcucGdtMnF1YWwgQVMgLDQxNCwzMywwODE1ZjRkNi1lZDdhLTRiZGMtYTAz
Mi0yNTllZWY2OTkyYmE7cmVwb3J0aW5nLnRibGFsbHByb2dyYW1tZXMgLDE5NSwxNSxiZGNhMTll
My05ZjRkLTQ3NWItYWQ2Ni1jZTFkMzRlZTIwNTQ7"/>    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Jasper Main Database Connection"/>    <property name="com.jaspersoft.studio.unit." value="pixel"/>    <property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>    <property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>    <property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>    <property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>    <property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>    <property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>    <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>    <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>    <parameter name="Programme Duration" class="java.lang.Float"/>    <parameter name="Qualification" class="java.util.Collection"/>    <parameter name="Semester" class="java.util.Collection"/>    <queryString language="SQL">        <![CDATA[sELECT reporting.tblallprogrammes.`PgmID`,    reporting.tblallprogrammes.`Faculty`,    reporting.tblallprogrammes.`NQFLevel`,    reporting.tblallprogrammes.`Credits`,    reporting.tblallprogrammes.`SAQAID`,    reporting.tblallprogrammes.`Duration`,    reporting.modules.`ModuleID`,    reporting.modules.`YearOfStdy`,    reporting.modules.`ModuleCode`,    reporting.modules.`ModuleName`,    reporting.modules.`Active` AS ModuleActive,    reporting.modules.`NQFLevel` AS ModuleNQFLevel,    reporting.modules.`Credits` AS ModuleCredits,    reporting.tblallprogrammes.`ProgrammeName`,    reporting.pgm2qual.qualFROM reporting.modules    INNER JOIN reporting.tblallprogrammes ON      reporting.modules.`ProgrammeName` = reporting.tblallprogrammes.`PgmID`           inner join     reporting.pgm2qual on      reporting.pgm2qual.pgm = reporting.tblallprogrammes.`ProgrammeName` WHERE      reporting.tblallprogrammes.`Faculty` = '1'      AND reporting.tblallprogrammes.`PgmID` <> '124'      AND reporting.modules.`Active` = '1'      AND $X{IN,reporting.tblallprogrammes.`ProgrammeName`,Qualification}]]>    </queryString>    <field name="PgmID" class="java.lang.Integer"/>    <field name="Faculty" class="java.lang.Integer"/>    <field name="NQFLevel" class="java.lang.Integer"/>    <field name="Credits" class="java.lang.Integer"/>    <field name="SAQAID" class="java.lang.String"/>    <field name="Duration" class="java.lang.String"/>    <field name="ModuleID" class="java.lang.Integer"/>    <field name="YearOfStdy" class="java.lang.Integer"/>    <field name="ModuleCode" class="java.lang.String"/>    <field name="ModuleName" class="java.lang.String"/>    <field name="ModuleActive" class="java.lang.Integer"/>    <field name="ModuleNQFLevel" class="java.lang.Integer"/>    <field name="ModuleCredits" class="java.lang.Integer"/>    <field name="ProgrammeName" class="java.lang.String"/>    <field name="qual" class="java.lang.String"/>    <sortField name="ProgrammeName"/>    <sortField name="ModuleCode"/>    <variable name="TotalCredits" class="java.lang.Float" resetType="Group" resetGroup="ProgrammeName" incrementType="Group" incrementGroup="Module Code" calculation="Sum">        <variableExpression><![CDATA[$F{ModuleCredits}]]></variableExpression>        <initialValueExpression><![CDATA[0]]></initialValueExpression>    </variable>    <variable name="TotalCreditValue" class="java.lang.Double" calculation="Sum">        <variableExpression><![CDATA[($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())*$P{Programme Duration}]]></variableExpression>        <initialValueExpression><![CDATA[0]]></initialValueExpression>    </variable>    <variable name="TotalCreditWeighting" class="java.lang.Integer" calculation="Sum">        <variableExpression><![CDATA[($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())]]></variableExpression>        <initialValueExpression><![CDATA[0]]></initialValueExpression>    </variable>    <variable name="TotalWeighting" class="java.lang.Integer" resetType="Group" resetGroup="ProgrammeName" calculation="Sum">        <variableExpression><![CDATA[$F{ModuleCredits}.intValue()/$V{TotalCredits}.intValue()*$P{Programme Duration}.intValue()]]></variableExpression>        <initialValueExpression><![CDATA[0]]></initialValueExpression>    </variable>    <variable name="MaleCount" class="java.lang.Integer" resetType="Group" resetGroup="Module Code">        <initialValueExpression><![CDATA[0]]></initialValueExpression>    </variable>    <variable name="FemaleCount" class="java.lang.Integer" resetType="Group" resetGroup="Module Code">        <initialValueExpression><![CDATA[0]]></initialValueExpression>    </variable>    <variable name="ManSucessCount" class="java.lang.Integer" resetType="Group" resetGroup="Module Code">        <initialValueExpression><![CDATA[0]]></initialValueExpression>    </variable>    <variable name="FemaleSuccessCount" class="java.lang.Integer" resetType="Group" resetGroup="Module Code">        <initialValueExpression><![CDATA[0]]></initialValueExpression>    </variable>    <variable name="FTE Male Total" class="java.lang.Double" incrementType="Column">        <variableExpression><![CDATA[$V{MaleCount}.doubleValue()*(($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())*$P{Programme Duration})]]></variableExpression>        <initialValueExpression><![CDATA[0]]></initialValueExpression>    </variable>    <group name="ProgrammeName">        <groupExpression><![CDATA[$F{ProgrammeName}]]></groupExpression>        <groupHeader>            <band height="56">                <textField>                    <reportElement x="113" y="0" width="367" height="20" uuid="841c6f74-ad1c-4105-b554-11852ddc329d"/>                    <textFieldExpression><![CDATA[$F{ProgrammeName}]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="0" y="0" width="100" height="20" uuid="5b83b955-899d-4ee9-9651-712553d23db2"/>                    <textFieldExpression><![CDATA["Programme Name:"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="-5" y="20" width="79" height="15" uuid="4dc256d0-1d8a-4eca-918e-da63cb52d005"/>                    <textFieldExpression><![CDATA["Module Code"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="74" y="20" width="79" height="15" uuid="dc5502ae-de9e-43fc-8acb-65979261ae43"/>                    <textFieldExpression><![CDATA["Module Name"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="179" y="20" width="30" height="30" uuid="6d92f9bb-d424-4461-a26c-e3546bb31113"/>                    <textFieldExpression><![CDATA["NQF Level"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="209" y="20" width="32" height="15" uuid="7e9c019c-250a-4d9f-b7a6-d9bcb61d64a9"/>                    <textFieldExpression><![CDATA["Credits"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="242" y="20" width="45" height="30" uuid="76bd9a23-9c50-4aef-8a2f-237d41d61cf8"/>                    <textFieldExpression><![CDATA["Credit Weighting"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="287" y="20" width="45" height="30" uuid="0212b27e-887f-48ae-9abc-ace37bacb06b"/>                    <textFieldExpression><![CDATA["Credit Value"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="336" y="18" width="106" height="15" uuid="ad7889bc-81f5-438f-a234-c61edd6358dd"/>                    <textElement textAlignment="Center"/>                    <textFieldExpression><![CDATA["Enrolment"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="336" y="38" width="36" height="15" uuid="adde65c3-2551-4aea-ba33-a4c088097739"/>                    <textFieldExpression><![CDATA["Male"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="372" y="38" width="39" height="15" uuid="37b6be57-5f61-4fcc-8c17-df5bee5a49b7"/>                    <textFieldExpression><![CDATA["Female"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="443" y="20" width="111" height="15" uuid="11a5c0ed-3f70-47ab-8c73-a70dce94610b"/>                    <textElement textAlignment="Center"/>                    <textFieldExpression><![CDATA["FTE Student Total"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="446" y="38" width="36" height="15" uuid="57c8b6ff-8120-47b1-a19a-80dcaafde00f"/>                    <textFieldExpression><![CDATA["Male"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="482" y="38" width="39" height="15" uuid="f316d65c-9d7e-4c3d-b72b-8d9e6f59810c"/>                    <textFieldExpression><![CDATA["Female"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="595" y="38" width="39" height="15" uuid="7a0fe748-b086-4597-9e0c-643e71ffc071"/>                    <textFieldExpression><![CDATA["Female"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="559" y="38" width="36" height="15" uuid="ea732f8b-6707-4b89-b49b-5db5ef1a1bd1"/>                    <textFieldExpression><![CDATA["Male"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="561" y="23" width="116" height="15" uuid="23743865-cf3a-494a-967e-38ae257baa26"/>                    <textElement textAlignment="Center"/>                    <textFieldExpression><![CDATA["Successfull Students"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="406" y="38" width="39" height="15" uuid="ee017852-c49f-43a5-8e08-238eeeac986d"/>                    <textElement>                        <font isBold="true"/>                    </textElement>                    <textFieldExpression><![CDATA["Total"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="519" y="39" width="39" height="15" uuid="338af3c8-7d8c-4d82-aec9-b99eeb409a13"/>                    <textElement>                        <font isBold="true"/>                    </textElement>                    <textFieldExpression><![CDATA["Total"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="639" y="39" width="39" height="15" uuid="0c1760c3-0945-44e8-acb1-123790198b4a"/>                    <textElement>                        <font isBold="true"/>                    </textElement>                    <textFieldExpression><![CDATA["Total"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="680" y="40" width="36" height="15" uuid="858772b8-c78c-4024-9e3f-69071ac8a131"/>                    <textFieldExpression><![CDATA["Male"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="716" y="40" width="39" height="15" uuid="0ee8c6a9-c094-432a-be82-dd22a468a1f9"/>                    <textFieldExpression><![CDATA["Female"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="760" y="41" width="39" height="15" uuid="e239db8a-0a55-4276-a4ad-436a17063885"/>                    <textElement>                        <font isBold="true"/>                    </textElement>                    <textFieldExpression><![CDATA["Total"]]></textFieldExpression>                </textField>                <textField>                    <reportElement x="675" y="24" width="123" height="15" uuid="c9a65827-8c3e-4b3b-ae3e-85c320b29bc5"/>                    <textElement textAlignment="Center"/>                    <textFieldExpression><![CDATA["FTE Successfull Students"]]></textFieldExpression>                </textField>            </band>        </groupHeader>        <groupFooter>            <band/>        </groupFooter>    </group>    <group name="Module Code">        <groupExpression><![CDATA[$F{ModuleCode}]]></groupExpression>        <groupHeader>            <band/>        </groupHeader>        <groupFooter>            <band/>        </groupFooter>    </group>    <background>        <band height="47" splitType="Stretch"/>    </background>    <title>        <band height="40" splitType="Stretch">            <textField>                <reportElement x="100" y="10" width="422" height="30" uuid="6af9ec0b-9509-4c22-becb-3e4e9ca26225"/>                <textFieldExpression><![CDATA["Full-time equivalent student enrolments"]]></textFieldExpression>            </textField>        </band>    </title>    <pageHeader>        <band height="35" splitType="Stretch"/>    </pageHeader>    <columnHeader>        <band height="22" splitType="Stretch"/>    </columnHeader>    <detail>        <band height="16" splitType="Stretch">            <textField>                <reportElement x="-5" y="0" width="72" height="15" uuid="1b824576-1ba3-4e03-8daa-a8a1b3ca6643"/>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{ModuleCode}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="69" y="0" width="109" height="15" uuid="1269b89f-0f18-4d48-b274-b79528d0d603"/>                <textElement verticalAlignment="Middle">                    <font size="8"/>                </textElement>                <textFieldExpression><![CDATA[$F{ModuleName}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="209" y="0" width="33" height="15" uuid="d9a983b6-3d29-46d4-a454-dbee91d574df"/>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{ModuleCredits}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="179" y="0" width="30" height="15" uuid="4634feff-e246-46f1-bdf7-1f5b0db7adc9"/>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{ModuleNQFLevel}]]></textFieldExpression>            </textField>            <textField evaluationTime="Auto" pattern="#.##">                <reportElement x="287" y="0" width="40" height="15" uuid="77392924-46b6-4e2c-9e8d-cd85b7f63be8"/>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())*$P{Programme Duration}]]></textFieldExpression>            </textField>            <textField evaluationTime="Auto" pattern="##.##%">                <reportElement x="242" y="0" width="34" height="15" uuid="91f256fe-69ee-4ff0-9619-6f2553d92cb8"/>                <textElement verticalAlignment="Middle">                    <font fontName="DejaVu Sans Mono"/>                </textElement>                <textFieldExpression><![CDATA[($F{ModuleCredits}/$V{TotalCredits})]]></textFieldExpression>            </textField>            <subreport>                <reportElement x="342" y="0" width="97" height="15" uuid="db6b4501-1fb3-452b-8268-54aaedf20e15"/>                <subreportParameter name="Qualification">                    <subreportParameterExpression><![CDATA[$F{qual}]]></subreportParameterExpression>                </subreportParameter>                <subreportParameter name="ModuleCode">                    <subreportParameterExpression><![CDATA[$F{ModuleCode}]]></subreportParameterExpression>                </subreportParameter>                <subreportParameter name="Semester">                    <subreportParameterExpression><![CDATA[$P{Semester}]]></subreportParameterExpression>                </subreportParameter>                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>                <returnValue subreportVariable="ManCount" toVariable="MaleCount"/>                <returnValue subreportVariable="FemaleCount" toVariable="FemaleCount"/>                <returnValue subreportVariable="ManCount" toVariable="FTE Male Total" calculation="Sum"/>                <subreportExpression><![CDATA["DHET Attendance.jasper"]]></subreportExpression>            </subreport>            <textField evaluationTime="Auto" pattern="#0.00">                <reportElement x="445" y="0" width="39" height="15" uuid="a6794a26-f975-4501-b976-9306aa19a48a"/>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$V{MaleCount}.doubleValue()*(($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())*$P{Programme Duration})]]></textFieldExpression>            </textField>            <textField evaluationTime="Auto" pattern="#0.00">                <reportElement x="484" y="0" width="39" height="15" uuid="0c544908-57f6-4568-bf38-16df033ae9e0"/>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$V{FemaleCount}.doubleValue()*(($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())*$P{Programme Duration})]]></textFieldExpression>            </textField>            <subreport>                <reportElement x="561" y="0" width="69" height="15" uuid="55ea75f3-a4be-434f-bdfc-a9150a3caaf5"/>                <subreportParameter name="Qualification">                    <subreportParameterExpression><![CDATA[$F{qual}]]></subreportParameterExpression>                </subreportParameter>                <subreportParameter name="ModuleCode">                    <subreportParameterExpression><![CDATA[$F{ModuleCode}]]></subreportParameterExpression>                </subreportParameter>                <subreportParameter name="Semester">                    <subreportParameterExpression><![CDATA[$P{Semester}]]></subreportParameterExpression>                </subreportParameter>                <connectionExpression><![CDATA[$P{REPORT_CONNECTION}]]></connectionExpression>                <returnValue subreportVariable="ManSucessCount" toVariable="ManSucessCount"/>                <returnValue subreportVariable="FemaleSuccessCount" toVariable="FemaleSuccessCount"/>                <subreportExpression><![CDATA["DHET Achievement.jasper"]]></subreportExpression>            </subreport>            <textField evaluationTime="Auto" pattern="#0.00">                <reportElement x="523" y="0" width="40" height="15" uuid="a2156e7a-583d-4836-925b-358748cbd718"/>                <textElement verticalAlignment="Middle">                    <font isBold="true"/>                </textElement>                <textFieldExpression><![CDATA[($V{FemaleCount}.doubleValue()*(($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())*$P{Programme Duration})) + ($V{MaleCount}.doubleValue()*(($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())*$P{Programme Duration}))]]></textFieldExpression>            </textField>            <textField evaluationTime="Auto" pattern="#0.00">                <reportElement x="677" y="1" width="39" height="15" uuid="0d1d2ff5-c6ff-4ff7-8d97-6df3884a455e"/>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$V{ManSucessCount}.doubleValue()*(($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())*$P{Programme Duration})]]></textFieldExpression>            </textField>            <textField evaluationTime="Auto" pattern="#.##">                <reportElement x="636" y="1" width="39" height="15" uuid="d9f1fc5d-3e2f-4a76-ac27-c6273452023f"/>                <textElement verticalAlignment="Middle">                    <font isBold="true"/>                </textElement>                <textFieldExpression><![CDATA[$V{ManSucessCount}+$V{FemaleSuccessCount}]]></textFieldExpression>            </textField>            <textField evaluationTime="Auto" pattern="#0.00">                <reportElement x="716" y="1" width="39" height="15" uuid="92f4ca68-2395-4e57-84b7-3aded9feb215"/>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$V{FemaleSuccessCount}.doubleValue()*(($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())*$P{Programme Duration})]]></textFieldExpression>            </textField>            <textField evaluationTime="Auto" pattern="#0.00">                <reportElement x="761" y="1" width="39" height="15" uuid="08c50e2f-754d-471e-8e8c-6de631b13e3c"/>                <textElement verticalAlignment="Middle">                    <font isBold="true"/>                </textElement>                <textFieldExpression><![CDATA[($V{ManSucessCount}.doubleValue()*(($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())*$P{Programme Duration}))+($V{FemaleSuccessCount}*(($F{ModuleCredits}.doubleValue()/$V{TotalCredits}.doubleValue())*$P{Programme Duration}))]]></textFieldExpression>            </textField>        </band>    </detail>    <columnFooter>        <band splitType="Stretch"/>    </columnFooter>    <pageFooter>        <band splitType="Stretch"/>    </pageFooter>    <summary>        <band height="15" splitType="Stretch">            <textField evaluationTime="Group" evaluationGroup="ProgrammeName" pattern="###">                <reportElement x="209" y="0" width="33" height="15" uuid="0a106b23-df07-4525-b61d-273d86b3d0d0"/>                <textFieldExpression><![CDATA[$V{TotalCredits}]]></textFieldExpression>            </textField>            <textField evaluationTime="Auto" pattern="### %">                <reportElement x="242" y="0" width="45" height="15" uuid="3187283c-886b-4520-bef1-1d1320794507"/>                <textFieldExpression><![CDATA[$V{TotalCreditWeighting}]]></textFieldExpression>            </textField>            <textField evaluationTime="Auto" pattern="">                <reportElement x="287" y="0" width="45" height="15" uuid="6bfb3c9f-2e1e-485f-b8dc-c4fd041729a3"/>                <textFieldExpression><![CDATA[$V{TotalWeighting}]]></textFieldExpression>            </textField>            <textField>                <reportElement x="444" y="0" width="39" height="15" uuid="a3241733-c83e-4c5b-b37c-78876ff9145d"/>                <textFieldExpression><![CDATA[$V{FTE Male Total}]]></textFieldExpression>            </textField>        </band>    </summary></jasperReport>[/code]

and my sub report 1 is

<?xml version="1.0" encoding="UTF-8"?><!-- Created with Jaspersoft Studio version 6.3.1.final using JasperReports Library version 6.3.1  --><!-- 2017-08-29T15:42:00 --><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="DHET Attendance" language="groovy" pageWidth="595" pageHeight="842" columnWidth="595" columnSpacing="15" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0" uuid="40a1a5f0-2641-4515-9a6e-2479197e8b39">    <property name="com.jaspersoft.studio.data.sql.tables" value=""/>    <property name="com.jaspersoft.studio.data.defaultdataadapter" value="Jasper Main Database Connection"/>    <property name="com.jaspersoft.studio.unit." value="pixel"/>    <property name="com.jaspersoft.studio.unit.pageHeight" value="pixel"/>    <property name="com.jaspersoft.studio.unit.pageWidth" value="pixel"/>    <property name="com.jaspersoft.studio.unit.topMargin" value="pixel"/>    <property name="com.jaspersoft.studio.unit.bottomMargin" value="pixel"/>    <property name="com.jaspersoft.studio.unit.leftMargin" value="pixel"/>    <property name="com.jaspersoft.studio.unit.rightMargin" value="pixel"/>    <property name="com.jaspersoft.studio.unit.columnWidth" value="pixel"/>    <property name="com.jaspersoft.studio.unit.columnSpacing" value="pixel"/>    <parameter name="Qualification" class="java.lang.String" isForPrompting="false"/>    <parameter name="ModuleCode" class="java.lang.String" isForPrompting="false"/>    <parameter name="Semester" class="java.util.Collection" isForPrompting="false"/>    <queryString language="SQL">        <![CDATA[select count(*) gender_count,sum(if(reporting.registration.Student_Gender='MALE',1,0)) Male_Count,sum(if(reporting.registration.Student_Gender='FEMALE',1,0)) Female_Countfrom reporting.registrationwhere Qualification =  $P{Qualification} andModuleCode =  $P{ModuleCode}and$X{IN, reporting.registration.`ActualSemester`,Semester }]]>    </queryString>    <field name="gender_count" class="java.lang.Long"/>    <field name="Male_Count" class="java.math.BigDecimal"/>    <field name="Female_Count" class="java.math.BigDecimal"/>    <variable name="ManCount" class="java.lang.Integer">        <variableExpression><![CDATA[$F{Male_Count}.intValue()]]></variableExpression>        <initialValueExpression><![CDATA[0]]></initialValueExpression>    </variable>    <variable name="FemaleCount" class="java.lang.Integer">        <variableExpression><![CDATA[$F{Female_Count}.intValue()]]></variableExpression>        <initialValueExpression><![CDATA[0]]></initialValueExpression>    </variable>    <background>        <band splitType="Stretch"/>    </background>    <title>        <band splitType="Stretch"/>    </title>    <pageHeader>        <band splitType="Stretch"/>    </pageHeader>    <columnHeader>        <band splitType="Stretch"/>    </columnHeader>    <detail>        <band height="15" splitType="Stretch">            <textField pattern="# ###">                <reportElement x="0" y="0" width="30" height="15" uuid="9712caa1-5913-4137-8702-d0f81fe670ad">                    <property name="com.jaspersoft.studio.unit.height" value="pixel"/>                </reportElement>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{Male_Count}]]></textFieldExpression>            </textField>            <textField pattern="# ###">                <reportElement x="30" y="0" width="30" height="15" uuid="12ed27dc-4285-4ef4-945f-287569bb48d6">                    <property name="com.jaspersoft.studio.unit.height" value="pixel"/>                </reportElement>                <textElement verticalAlignment="Middle"/>                <textFieldExpression><![CDATA[$F{Female_Count}]]></textFieldExpression>            </textField>            <textField pattern="# ###">                <reportElement x="60" y="0" width="30" height="15" uuid="405cb2a7-91f9-4c0c-a9a7-2bdf5d6193b5">                    <property name="com.jaspersoft.studio.unit.height" value="pixel"/>                </reportElement>                <textElement verticalAlignment="Middle">                    <font isBold="true"/>                </textElement>                <textFieldExpression><![CDATA[$F{gender_count}]]></textFieldExpression>            </textField>        </band>    </detail>    <columnFooter>        <band splitType="Stretch"/>    </columnFooter>    <pageFooter>        <band splitType="Stretch"/>    </pageFooter>    <summary>        <band splitType="Stretch"/>    </summary></jasperReport>[/code]

My second sub report is almost identical to the first.

I am sure that there is a simple solution that I have missed.

Kind Regards

PN

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Top Posters In This Topic

This report is designed to show student through puts for a specific qualification(programme). each programme consists of various modules. We need to calculate a figure for enrolments on certain criteria namely the total number of enrolments (broken down by gender and returned from a subreport) and the weighting (Credit Value) of the module in the programme.

My problem field is the total for all modules. I need to add each of the enrolment calculations.The Total for the Calculated fields is in a variable

Name: FTE Male Total

Value Class Name: java.lang.Double

Calculation: Sum

Expression: Credit Value * Male enrolment

Initial Value Expression: 0

Inrement Type: Module Code

Reset Type: Programme

This field is in the summary band of the report and the evaluation time is set to Band.  I still am not able to get the correct total for this calculation

Link to comment
Share on other sites

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...