<?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="BOL1_subreport2"  pageWidth="572" pageHeight="752" columnWidth="555" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="DESP_DESP_ID" class="java.lang.String"/>
	<queryString>
		<![CDATA[select
		 count(*) as count,
		 p.pick_type as pick_type,
		 sum(c.no_art) as tot_pkt,
		 sum(dD.gross_weight) as gross_weigh,
		 O.HAZARD_YN AS HAZARD_YN,
		 I.NMFC_NO AS NMFC_NO,
			(SELECT FN_GET_GEN_DESC ('NMFC_NO',I.NMFC_NO) FROM DUAL) AS NMFC_DESCR,
		 I.FRT_CLASS AS FRT_CLASS
from
	pick_ord_hdr p, pick_ord_det c, despatch d, DESPATCHDET DD, ITEM I, SORDER O
where
			  D.desp_id = $P{DESP_DESP_ID}
		AND DD.DESP_ID = D.DESP_ID
		AND d.wave_id = p.wave_id
		AND c.pick_order = p.pick_order
		AND C.SALE_ORDER = O.SALE_ORDER
		AND O.SITE_CODE = I.SITE_CODE
group by
 p.pick_type, 		i.nmfc_NO,	i.frt_class, o.hazard_yn]]>
	</queryString>
	<field name="COUNT" class="java.lang.String"/>
	<field name="PICK_TYPE" class="java.lang.String"/>
	<field name="TOT_PKT" class="java.lang.String"/>
	<field name="GROSS_WEIGH" class="java.lang.String"/>
	<field name="HAZARD_YN" class="java.lang.String"/>
	<field name="NMFC_NO" class="java.lang.String"/>
	<field name="NMFC_DESCR" class="java.lang.String"/>
	<field name="FRT_CLASS" class="java.lang.String"/>
	<variable name="TOT_PKT_3" class="java.lang.String" resetType="Group" resetGroup="GRAND_TOTAL" calculation="Sum">
		<variableExpression><![CDATA[$F{TOT_PKT}]]></variableExpression>
	</variable>
	<variable name="COUNT_3" class="java.lang.String" resetType="Group" resetGroup="GRAND_TOTAL" calculation="Sum">
		<variableExpression><![CDATA[$F{COUNT}]]></variableExpression>
	</variable>
	<variable name="GROSS_WEIGH_2" class="java.lang.String" resetType="Group" resetGroup="GRAND_TOTAL" calculation="Sum">
		<variableExpression><![CDATA[$F{GROSS_WEIGH}]]></variableExpression>
	</variable>
	<group name="GRAND_TOTAL">
		<groupExpression><![CDATA[$V{GROSS_WEIGH_2}]]></groupExpression>
		<groupFooter>
			<band height="15">
				<line>
					<reportElement x="5" y="0" width="1" height="15"/>
				</line>
				<rectangle>
					<reportElement x="104" y="0" width="33" height="15" backcolor="#AD9CA4"/>
				</rectangle>
				<rectangle>
					<reportElement x="38" y="0" width="33" height="15" backcolor="#AD9CA4"/>
				</rectangle>
				<rectangle>
					<reportElement x="479" y="0" width="44" height="15" backcolor="#AD9CA4"/>
				</rectangle>
				<rectangle>
					<reportElement x="523" y="0" width="41" height="15" backcolor="#AD9CA4"/>
				</rectangle>
				<staticText>
					<reportElement x="297" y="0" width="100" height="15"/>
					<textElement>
						<font fontName="Arial" size="10" isBold="true"/>
					</textElement>
					<text><![CDATA[GRAND TOTAL]]></text>
				</staticText>
				<rectangle>
					<reportElement x="202" y="0" width="40" height="15" backcolor="#AD9CA4"/>
				</rectangle>
				<textField>
					<reportElement x="73" y="2" width="30" height="12"/>
					<textElement textAlignment="Right">
						<font fontName="Arial"/>
					</textElement>
					<textFieldExpression><![CDATA[$V{TOT_PKT_3}.equals(null)?"":$V{TOT_PKT_3}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement x="8" y="2" width="30" height="12"/>
					<textElement textAlignment="Right">
						<font fontName="Arial"/>
					</textElement>
					<textFieldExpression><![CDATA[$V{COUNT_3}.equals(null)?"":$V{COUNT_3}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement x="139" y="2" width="60" height="12"/>
					<textElement textAlignment="Right">
						<font fontName="Arial"/>
					</textElement>
					<textFieldExpression><![CDATA[$V{GROSS_WEIGH_2}.equals(null)?"":$V{GROSS_WEIGH_2}]]></textFieldExpression>
				</textField>
			</band>
		</groupFooter>
	</group>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band splitType="Stretch"/>
	</title>
	<pageHeader>
		<band splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band height="61" splitType="Stretch">
			<staticText>
				<reportElement x="107" y="46" width="25" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[TYPE]]></text>
			</staticText>
			<staticText>
				<reportElement x="13" y="46" width="20" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[QTY]]></text>
			</staticText>
			<staticText>
				<reportElement x="15" y="19" width="50" height="25"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[HANDLING UNIT]]></text>
			</staticText>
			<line>
				<reportElement x="480" y="35" width="84" height="1"/>
			</line>
			<line>
				<reportElement x="71" y="14" width="1" height="47"/>
			</line>
			<line>
				<reportElement x="523" y="35" width="1" height="26"/>
			</line>
			<line>
				<reportElement x="38" y="43" width="1" height="18"/>
			</line>
			<staticText>
				<reportElement x="80" y="19" width="50" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[PACKAGE]]></text>
			</staticText>
			<line>
				<reportElement x="104" y="43" width="1" height="18"/>
			</line>
			<staticText>
				<reportElement x="498" y="19" width="50" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[LTL ONLY]]></text>
			</staticText>
			<staticText>
				<reportElement x="79" y="45" width="20" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[QTY]]></text>
			</staticText>
			<staticText>
				<reportElement x="256" y="36" width="220" height="25"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="6" isBold="true"/>
				</textElement>
				<text><![CDATA[Commodities requiring special or additional care or attention in handling or stowing must be so marked and packaged as to ensure safe transportation with ordinary care.]]></text>
			</staticText>
			<line>
				<reportElement x="241" y="15" width="1" height="46"/>
			</line>
			<staticText>
				<reportElement mode="Opaque" x="5" y="0" width="560" height="15" forecolor="#FEFEFE" backcolor="#010101"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Arial" size="8" isBold="true"/>
				</textElement>
				<text><![CDATA[CARRIER INFORMATION]]></text>
			</staticText>
			<staticText>
				<reportElement x="144" y="30" width="50" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[WEIGHT]]></text>
			</staticText>
			<line direction="BottomUp">
				<reportElement x="5" y="14" width="1" height="47"/>
			</line>
			<line>
				<reportElement x="479" y="14" width="1" height="47"/>
			</line>
			<staticText>
				<reportElement x="210" y="28" width="20" height="25"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[H.M. (X)]]></text>
			</staticText>
			<line>
				<reportElement x="5" y="42" width="132" height="1"/>
			</line>
			<staticText>
				<reportElement x="524" y="37" width="35" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[CLASS]]></text>
			</staticText>
			<staticText>
				<reportElement x="484" y="37" width="35" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[NMFC #]]></text>
			</staticText>
			<line>
				<reportElement x="564" y="14" width="1" height="47"/>
			</line>
			<line>
				<reportElement x="137" y="14" width="1" height="47"/>
			</line>
			<staticText>
				<reportElement x="282" y="19" width="150" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="10" isBold="true"/>
				</textElement>
				<text><![CDATA[COMMODITY DESCRIPTION]]></text>
			</staticText>
			<line>
				<reportElement x="202" y="14" width="1" height="47"/>
			</line>
			<staticText>
				<reportElement x="42" y="46" width="25" height="15"/>
				<textElement textAlignment="Center">
					<font fontName="Arial" size="9" isBold="true"/>
				</textElement>
				<text><![CDATA[TYPE]]></text>
			</staticText>
			<staticText>
				<reportElement x="257" y="2" width="100" height="20"/>
				<textElement/>
				<text><![CDATA[NMFC_DESCR]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="16" splitType="Stretch">
			<line>
				<reportElement x="5" y="0" width="560" height="1"/>
			</line>
			<line>
				<reportElement x="5" y="15" width="560" height="1"/>
			</line>
			<line>
				<reportElement x="5" y="0" width="1" height="15"/>
			</line>
			<line>
				<reportElement x="38" y="0" width="1" height="15"/>
			</line>
			<line>
				<reportElement x="71" y="0" width="1" height="15"/>
			</line>
			<line>
				<reportElement x="104" y="0" width="1" height="15"/>
			</line>
			<line>
				<reportElement x="137" y="0" width="1" height="15"/>
			</line>
			<line>
				<reportElement x="202" y="0" width="1" height="15"/>
			</line>
			<line>
				<reportElement x="241" y="0" width="1" height="15"/>
			</line>
			<line>
				<reportElement x="479" y="0" width="1" height="15"/>
			</line>
			<line>
				<reportElement x="523" y="0" width="1" height="15"/>
			</line>
			<line>
				<reportElement x="564" y="0" width="1" height="15"/>
			</line>
			<staticText>
				<reportElement x="106" y="2" width="30" height="12"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Arial"/>
				</textElement>
				<text><![CDATA[CTN]]></text>
			</staticText>
			<textField>
				<reportElement x="5" y="3" width="30" height="12"/>
				<textElement textAlignment="Right">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{COUNT}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="40" y="3" width="30" height="12"/>
				<textElement textAlignment="Center">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{PICK_TYPE}.equals("A")?"CTN":($F{PICK_TYPE}.equals("C")?"PLT":"")]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="72" y="2" width="30" height="12"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{TOT_PKT}.equals(null)?"":$F{TOT_PKT}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="527" y="3" width="35" height="12"/>
				<textElement textAlignment="Center">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{FRT_CLASS}.equals(null)?"":$F{FRT_CLASS}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="482" y="3" width="40" height="12"/>
				<textElement textAlignment="Center">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{NMFC_NO}.equals(null)?"":$F{NMFC_NO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="206" y="3" width="30" height="12"/>
				<textElement textAlignment="Center">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{HAZARD_YN}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="138" y="2" width="60" height="12"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{GROSS_WEIGH}.equals(null)?"":$F{GROSS_WEIGH}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="245" y="2" width="230" height="12"/>
				<textElement textAlignment="Center">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{NMFC_DESCR}.equals(null)?"":$F{NMFC_DESCR}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
