<?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="McKesson shipping label" pageWidth="612" pageHeight="792" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<property name="ireport.zoom" value="1.5"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<parameter name="DESP_ID_START" class="java.lang.String"/>
	<parameter name="DESP_ID_LAST" class="java.lang.String"/>
	<queryString>
		<![CDATA[SELECT
		CASE WHEN S.ADD1 IS NULL THEN ' ' ELSE S.ADD1 END AS ADD1,
		CASE WHEN S.ADD2 IS NULL THEN ' ' ELSE S.ADD2 END AS ADD2,
		CASE WHEN S.CITY IS NULL THEN ' ' ELSE S.CITY END AS CITY,
		CASE WHEN S.PIN IS NULL THEN ' ' ELSE S.PIN END AS PIN,
		CASE WHEN S.STATE_CODE IS NULL THEN ' ' ELSE S.STATE_CODE END AS STATE_CODE,
		CASE WHEN O.DLV_ADD1 IS NULL THEN ' ' ELSE O.DLV_ADD1 END AS DLV_ADD1,
		CASE WHEN O.DLV_ADD2 IS NULL THEN ' ' ELSE O.DLV_ADD2 END AS DLV_ADD2,
		CASE WHEN O.DLV_ADD3 IS NULL THEN ' ' ELSE O.DLV_ADD3 END AS DLV_ADD3,
		CASE WHEN O.DLV_CITY IS NULL THEN ' ' ELSE O.DLV_CITY END AS DLV_CITY,
		CASE WHEN O.STATE_CODE__DLV IS NULL THEN ' ' ELSE O.STATE_CODE__DLV END AS STATE_CODE__DLV,
		CASE WHEN O.DLV_PIN IS NULL THEN ' ' ELSE O.DLV_PIN END AS DLV_PIN,
		CASE WHEN E.CUST_ITEM__REF IS NULL THEN ' ' ELSE E.CUST_ITEM__REF END AS CUST_ITEM__REF,
		CASE WHEN O.ORDER_TYPE IS NULL THEN ' ' ELSE O.ORDER_TYPE END AS ORDER_TYPE,
		CASE WHEN O.DEPT_CODE IS NULL THEN ' ' ELSE O.DEPT_CODE END AS DEPT_CODE,
		CASE WHEN D.TRAN_CODE IS NULL THEN ' ' ELSE D.TRAN_CODE END AS TRAN_CODE,
		CASE WHEN O.CUST_PORD IS NULL THEN ' ' ELSE O.CUST_PORD END AS CUST_PORD,
		CASE WHEN D.PRO_NO IS NULL THEN ' ' ELSE D.PRO_NO END AS PRO_NO,
		CASE WHEN D.BOL_NO IS NULL THEN ' ' ELSE D.BOL_NO END AS BOL_NO,
		CASE WHEN C.STORE_NUMBER IS NULL THEN ' ' ELSE C.STORE_NUMBER END AS STORE_NUMBER,
		CASE WHEN E.SSCC_18 IS NULL THEN ' ' ELSE E.SSCC_18 END AS SSCC_18,
		CASE WHEN N.SSCC_14 IS NULL THEN ' ' ELSE N.SSCC_14 END AS SSCC_14
FROM
		SITE S, SORDER O, SORDDET T, DESPATCH D, DESPATCHDET E, CUSTOMER C, ASN_DET N
WHERE
			 (D.DESP_ID BETWEEN $P{DESP_ID_START} AND $P{DESP_ID_LAST})
		AND O.SALE_ORDER = D.SORD_NO
		AND S.SITE_CODE = O.SITE_CODE
		AND E.DESP_ID = D.DESP_ID
		AND O.CUST_CODE__DLV = C.CUST_CODE
		AND T.SALE_ORDER = O.SALE_ORDER
		AND T.ITEM_CODE = N.ITEM_CODE]]>
	</queryString>
	<field name="ADD1" class="java.lang.String"/>
	<field name="ADD2" class="java.lang.String"/>
	<field name="CITY" class="java.lang.String"/>
	<field name="PIN" class="java.lang.String"/>
	<field name="STATE_CODE" class="java.lang.String"/>
	<field name="DLV_ADD1" class="java.lang.String"/>
	<field name="DLV_ADD2" class="java.lang.String"/>
	<field name="DLV_ADD3" class="java.lang.String"/>
	<field name="DLV_CITY" class="java.lang.String"/>
	<field name="STATE_CODE__DLV" class="java.lang.String"/>
	<field name="DLV_PIN" class="java.lang.String"/>
	<field name="CUST_ITEM__REF" class="java.lang.String"/>
	<field name="ORDER_TYPE" class="java.lang.String"/>
	<field name="DEPT_CODE" class="java.lang.String"/>
	<field name="TRAN_CODE" class="java.lang.String"/>
	<field name="CUST_PORD" class="java.lang.String"/>
	<field name="PRO_NO" class="java.lang.String"/>
	<field name="BOL_NO" class="java.lang.String"/>
	<field name="STORE_NUMBER" class="java.lang.String"/>
	<field name="SSCC_18" class="java.lang.String"/>
	<field name="SSCC_14" class="java.lang.String"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band splitType="Stretch"/>
	</title>
	<pageHeader>
		<band splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band height="472" splitType="Stretch">
			<rectangle>
				<reportElement mode="Transparent" x="10" y="10" width="288" height="432"/>
			</rectangle>
			<staticText>
				<reportElement x="19" y="19" width="80" height="12"/>
				<textElement>
					<font fontName="Arial" isBold="true"/>
				</textElement>
				<text><![CDATA[From:]]></text>
			</staticText>
			<line>
				<reportElement x="106" y="10" width="1" height="72"/>
			</line>
			<staticText>
				<reportElement x="118" y="19" width="100" height="12"/>
				<textElement>
					<font fontName="Arial" isBold="true"/>
				</textElement>
				<text><![CDATA[TO:]]></text>
			</staticText>
			<staticText>
				<reportElement x="13" y="90" width="128" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<text><![CDATA[(420) Ship to Postal Code:]]></text>
			</staticText>
			<line>
				<reportElement x="10" y="298" width="288" height="1"/>
			</line>
			<line>
				<reportElement x="10" y="226" width="288" height="1"/>
			</line>
			<staticText>
				<reportElement x="41" y="164" width="30" height="15"/>
				<textElement>
					<font fontName="Arial" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[DC#]]></text>
			</staticText>
			<staticText>
				<reportElement x="88" y="164" width="30" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Top">
					<font fontName="Arial" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Type]]></text>
			</staticText>
			<line>
				<reportElement x="10" y="82" width="288" height="1"/>
			</line>
			<line>
				<reportElement x="10" y="154" width="288" height="1"/>
			</line>
			<line>
				<reportElement x="154" y="82" width="1" height="72"/>
			</line>
			<staticText>
				<reportElement x="162" y="118" width="35" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font fontName="Arial" size="12"/>
				</textElement>
				<text><![CDATA[PRO:]]></text>
			</staticText>
			<staticText>
				<reportElement x="162" y="88" width="80" height="12"/>
				<textElement verticalAlignment="Middle">
					<font fontName="Arial"/>
				</textElement>
				<text><![CDATA[CARRIER:]]></text>
			</staticText>
			<staticText>
				<reportElement x="141" y="164" width="30" height="15"/>
				<textElement>
					<font fontName="Arial" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[DEPT]]></text>
			</staticText>
			<staticText>
				<reportElement x="186" y="164" width="50" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Top">
					<font fontName="Arial" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[Order #]]></text>
			</staticText>
			<staticText>
				<reportElement x="162" y="134" width="35" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font fontName="Arial" size="12"/>
				</textElement>
				<text><![CDATA[B/L :]]></text>
			</staticText>
			<staticText>
				<reportElement x="27" y="204" width="45" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Top">
					<font fontName="Arial" size="12" isBold="true"/>
				</textElement>
				<text><![CDATA[WMIT :]]></text>
			</staticText>
			<textField>
				<reportElement x="18" y="33" width="80" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{ADD1}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="18" y="47" width="80" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{ADD2}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="17" y="62" width="35" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{CITY}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="53" y="62" width="15" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{STATE_CODE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="69" y="62" width="35" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{PIN}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="197" y="62" width="45" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DLV_PIN}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="118" y="62" width="55" height="12"/>
				<textElement textAlignment="Right">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DLV_ADD3}+""+$F{DLV_CITY}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="119" y="47" width="120" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DLV_ADD2}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="176" y="62" width="20" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{STATE_CODE__DLV}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="119" y="33" width="120" height="12"/>
				<textElement>
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DLV_ADD1}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="197" y="118" width="80" height="15"/>
				<textElement verticalAlignment="Middle">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{PRO_NO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="197" y="134" width="80" height="15"/>
				<textElement verticalAlignment="Middle">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{CUST_PORD}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="165" y="101" width="100" height="15"/>
				<textElement textAlignment="Left" verticalAlignment="Middle">
					<font fontName="Arial"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{TRAN_CODE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="25" y="180" width="50" height="12"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Arial" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{STORE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="77" y="180" width="50" height="12"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Arial" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{ORDER_TYPE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="130" y="180" width="50" height="12"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Arial" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DEPT_CODE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="187" y="180" width="50" height="12"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Arial" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{CUST_PORD}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="71" y="204" width="150" height="15"/>
				<textElement>
					<font fontName="Arial" size="12" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{CUST_ITEM__REF}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="26" y="247" width="250" height="30"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Arial" size="12" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SSCC_18}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="19" y="116" width="87" height="17"/>
				<textElement>
					<font fontName="Code 128AB" size="24"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{DLV_PIN}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="26" y="310" width="250" height="99"/>
				<textElement textAlignment="Center" verticalAlignment="Middle">
					<font fontName="Code 128AB" size="48" isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{SSCC_18}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band splitType="Stretch"/>
	</pageFooter>
	<summary>
		<band splitType="Stretch"/>
	</summary>
</jasperReport>
