<?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="shippers_Expo_subreport1_tot" pageWidth="555" pageHeight="802" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="2.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="DespId" class="java.lang.String"/>
	<queryString>
		<![CDATA[SELECT
  SUM(case when DESPATCHDET."QUANTITY__STDUOM" is null then 0 else  DESPATCHDET."QUANTITY__STDUOM" end)  AS DESPATCHDET_QUANTITY,
SUM(( (case when DESPATCHDET."QUANTITY__STDUOM" is null then 0 else  DESPATCHDET."QUANTITY__STDUOM" end)  * (case when  DESPATCHDET."RATE__STDUOM" is null then 0 else DESPATCHDET."RATE__STDUOM" end))) AS DESPATCHDET_RATE__STDUOM,
    SUM(case when  DESPATCHDET."GROSS_WEIGHT" is null then 0 else  DESPATCHDET."GROSS_WEIGHT" end)  AS DESPATCH_GROSS_WEIGHT
FROM
     "DESPATCHDET" DESPATCHDET,
     "DESPATCH" DESPATCH
WHERE
    DESPATCHDET."DESP_ID" = DESPATCH."DESP_ID"
   AND DESPATCH."DESP_ID" = '$P!{DespId}']]>
	</queryString>
	<field name="DESPATCHDET_QUANTITY" class="java.lang.Double"/>
	<field name="DESPATCHDET_RATE__STDUOM" class="java.lang.Double"/>
	<field name="DESPATCH_GROSS_WEIGHT" class="java.lang.Double"/>
	<variable name="variable1" class="java.lang.Double" calculation="Sum">
		<variableExpression><![CDATA[new java.lang.Double($F{DESPATCHDET_QUANTITY}.doubleValue())]]></variableExpression>
	</variable>
	<variable name="variable2" class="java.lang.Double" calculation="Sum">
		<variableExpression><![CDATA[new java.lang.Double(($F{DESPATCH_GROSS_WEIGHT}.doubleValue())/2.20462262185)]]></variableExpression>
	</variable>
	<variable name="variable3" class="java.lang.Double" calculation="Sum">
		<variableExpression><![CDATA[new java.lang.Double($F{DESPATCHDET_RATE__STDUOM}.doubleValue())]]></variableExpression>
	</variable>
	<title>
		<band splitType="Stretch"/>
	</title>
	<pageFooter>
		<band height="11" splitType="Stretch">
			<staticText>
				<reportElement positionType="Float" x="100" y="1" width="43" height="10"/>
				<textElement>
					<font size="7" isBold="true"/>
				</textElement>
				<text><![CDATA[TOTALS]]></text>
			</staticText>
			<textField pattern="###0.0000" isBlankWhenNull="true">
				<reportElement positionType="FixRelativeToBottom" x="235" y="1" width="55" height="9"/>
				<textElement textAlignment="Right">
					<font size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$V{variable1}]]></textFieldExpression>
			</textField>
			<textField pattern="###0.00" isBlankWhenNull="true">
				<reportElement positionType="FixRelativeToBottom" x="302" y="1" width="55" height="9"/>
				<textElement textAlignment="Right">
					<font size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$V{variable2}]]></textFieldExpression>
			</textField>
			<textField pattern="###0.0000" isBlankWhenNull="true">
				<reportElement positionType="FixRelativeToBottom" x="483" y="1" width="61" height="9"/>
				<textElement textAlignment="Right">
					<font size="7"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$V{variable3}]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<summary>
		<band splitType="Prevent"/>
	</summary>
</jasperReport>
