<?xml version="1.0" encoding="UTF-8"  ?>
<!-- Created with iReport - A designer for JasperReports -->
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">
<jasperReport
		 name="report01_per-stock_group"
		 columnCount="1"
		 printOrder="Vertical"
		 orientation="Portrait"
		 pageWidth="650"
		 pageHeight="930"
		 columnWidth="650"
		 columnSpacing="0"
		 leftMargin="0"
		 rightMargin="0"
		 topMargin="0"
		 bottomMargin="0"
		 whenNoDataType="AllSectionsNoDetail"
		 isTitleNewPage="false"
		 isSummaryNewPage="false">
	<property name="ireport.scriptlethandling" value="0" />
	<property name="ireport.encoding" value="UTF-8" />
	<import value="java.util.*" />
	<import value="net.sf.jasperreports.engine.*" />
	<import value="net.sf.jasperreports.engine.data.*" />

	<parameter name="date_from" isForPrompting="true" class="java.util.Date"/>
	<parameter name="date_end" isForPrompting="true" class="java.util.Date"/>
	<parameter name="stock_group" isForPrompting="true" class="java.lang.String"/>
	<parameter name="item_code" isForPrompting="true" class="java.lang.String"/>
	<parameter name="username" isForPrompting="true" class="java.lang.String"/>
	<queryString><![CDATA[call spireport01_per_stock_group($P{stock_group},$P{item_code},$P{date_from},$P{date_end})]]></queryString>

	<field name="ftcompany_name" class="java.lang.String"/>
	<field name="ftitem_code" class="java.lang.String"/>
	<field name="ftitem_name" class="java.lang.String"/>
	<field name="ftstock_group_code" class="java.lang.String"/>
	<field name="ftstock_group_name" class="java.lang.String"/>
	<field name="fnsaldo_awal" class="java.lang.Double"/>
	<field name="fnmasuk" class="java.lang.Double"/>
	<field name="fnkeluar" class="java.lang.Double"/>
	<field name="fnsaldo_akhir" class="java.lang.Double"/>

	<variable name="urut" class="java.lang.Integer" resetType="Group" resetGroup="g_group_code" calculation="Count">
		<variableExpression><![CDATA[new java.lang.Integer(0)]]></variableExpression>
		<initialValueExpression><![CDATA[new java.lang.Integer(1)]]></initialValueExpression>
	</variable>
	<variable name="g_awal" class="java.lang.Double" resetType="Group" resetGroup="g_group_code" calculation="Sum">
		<variableExpression><![CDATA[$F{fnsaldo_awal}]]></variableExpression>
	</variable>
	<variable name="g_masuk" class="java.lang.Double" resetType="Group" resetGroup="g_group_code" calculation="Sum">
		<variableExpression><![CDATA[$F{fnmasuk}]]></variableExpression>
	</variable>
	<variable name="g_keluar" class="java.lang.Double" resetType="Group" resetGroup="g_group_code" calculation="Sum">
		<variableExpression><![CDATA[$F{fnkeluar}]]></variableExpression>
	</variable>
	<variable name="g_akhir" class="java.lang.Double" resetType="Group" resetGroup="g_group_code" calculation="Sum">
		<variableExpression><![CDATA[$F{fnsaldo_akhir}]]></variableExpression>
	</variable>
	<variable name="t_awal" class="java.lang.Double" resetType="Report" calculation="Sum">
		<variableExpression><![CDATA[$F{fnsaldo_awal}]]></variableExpression>
	</variable>
	<variable name="t_masuk" class="java.lang.Double" resetType="Report" calculation="Sum">
		<variableExpression><![CDATA[$F{fnmasuk}]]></variableExpression>
	</variable>
	<variable name="t_keluar" class="java.lang.Double" resetType="Report" calculation="Sum">
		<variableExpression><![CDATA[$F{fnkeluar}]]></variableExpression>
	</variable>
	<variable name="t_akhir" class="java.lang.Double" resetType="Report" calculation="Sum">
		<variableExpression><![CDATA[$F{fnsaldo_akhir}]]></variableExpression>
	</variable>

		<group  name="g_company_name" >
			<groupExpression><![CDATA[$F{ftcompany_name}]]></groupExpression>
			<groupHeader>
			<band height="0"  isSplitAllowed="true" >
			</band>
			</groupHeader>
			<groupFooter>
			<band height="30"  isSplitAllowed="false" >
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="355"
						y="0"
						width="60"
						height="30"
						key="textField-5"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{t_awal}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="415"
						y="0"
						width="60"
						height="30"
						key="textField-6"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{t_masuk}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="475"
						y="0"
						width="60"
						height="30"
						key="textField-7"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{t_keluar}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="535"
						y="0"
						width="60"
						height="30"
						key="textField-8"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{t_akhir}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="0"
						y="0"
						width="355"
						height="30"
						key="staticText-11"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[GRAND TOTAL : ]]></text>
				</staticText>
			</band>
			</groupFooter>
		</group>
		<group  name="g_group_code" >
			<groupExpression><![CDATA[$F{ftstock_group_code}]]></groupExpression>
			<groupHeader>
			<band height="18"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="0"
						y="0"
						width="355"
						height="18"
						key="textField"/>
					<box>					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftstock_group_code} + " - " + $F{ftstock_group_name}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="355"
						y="0"
						width="240"
						height="18"
						key="staticText-13"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Arial" pdfFontName="Helvetica-Bold" size="11" isBold="true"/>
					</textElement>
				<text><![CDATA[]]></text>
				</staticText>
			</band>
			</groupHeader>
			<groupFooter>
			<band height="25"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="355"
						y="0"
						width="60"
						height="25"
						key="textField"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{g_awal}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="415"
						y="0"
						width="60"
						height="25"
						key="textField"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{g_masuk}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="475"
						y="0"
						width="60"
						height="25"
						key="textField"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{g_keluar}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="535"
						y="0"
						width="60"
						height="25"
						key="textField"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$V{g_akhir}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="0"
						y="0"
						width="355"
						height="25"
						key="staticText-14"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[TOTAL : ]]></text>
				</staticText>
			</band>
			</groupFooter>
		</group>
		<background>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</background>
		<title>
			<band height="1"  isSplitAllowed="true" >
			</band>
		</title>
		<pageHeader>
			<band height="73"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="0"
						y="0"
						width="355"
						height="17"
						key="textField"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftcompany_name}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="0"
						y="17"
						width="595"
						height="18"
						key="staticText-1"/>
					<box></box>
					<textElement textAlignment="Center" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="12" isBold="true"/>
					</textElement>
				<text><![CDATA[LAPORAN PERSEDIAAN PER STOCK GROUP]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="0"
						y="53"
						width="25"
						height="20"
						key="staticText-2"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[NO.]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="355"
						y="0"
						width="240"
						height="17"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of " + $V{PAGE_NUMBER}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement
						x="25"
						y="53"
						width="330"
						height="20"
						key="staticText-4"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[NAMA BARANG]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="355"
						y="53"
						width="60"
						height="20"
						key="staticText-5"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[AWAL]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="415"
						y="53"
						width="60"
						height="20"
						key="staticText-6"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[MASUK]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="475"
						y="53"
						width="60"
						height="20"
						key="staticText-7"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[KELUAR]]></text>
				</staticText>
				<staticText>
					<reportElement
						x="535"
						y="53"
						width="60"
						height="20"
						key="staticText-8"/>
					<box>					<topPen lineWidth="0.5" lineStyle="Solid"/>
					<bottomPen lineWidth="0.5" lineStyle="Solid"/>
</box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[AKHIR]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" pattern="dd-MMM-yyyy" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="0"
						y="35"
						width="595"
						height="18"
						key="textField-11"/>
					<box></box>
					<textElement verticalAlignment="Middle">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["Periode : " +  new SimpleDateFormat("dd-MMM-yyyy").format($P{date_from}) + " s/d : " + new SimpleDateFormat("dd-MMM-yyyy").format($P{date_end})]]></textFieldExpression>
				</textField>
			</band>
		</pageHeader>
		<columnHeader>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnHeader>
		<detail>
			<band height="17"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="0"
						y="0"
						width="25"
						height="17"
						key="textField"/>
					<box></box>
					<textElement verticalAlignment="Top">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.Integer"><![CDATA[$V{urut}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="25"
						y="0"
						width="55"
						height="17"
						key="textField"
						stretchType="RelativeToBandHeight"
						isPrintWhenDetailOverflows="true"/>
					<box></box>
					<textElement verticalAlignment="Top">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftitem_code}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="355"
						y="0"
						width="60"
						height="17"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Top">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$F{fnsaldo_awal}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="415"
						y="0"
						width="60"
						height="17"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Top">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$F{fnmasuk}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="475"
						y="0"
						width="60"
						height="17"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Top">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$F{fnkeluar}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="#,##0" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="535"
						y="0"
						width="60"
						height="17"
						key="textField"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Top">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.Double"><![CDATA[$F{fnsaldo_akhir}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="80"
						y="0"
						width="275"
						height="17"
						key="textField-18"
						stretchType="RelativeToBandHeight"
						isPrintWhenDetailOverflows="true"/>
					<box></box>
					<textElement verticalAlignment="Top">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{ftitem_name}]]></textFieldExpression>
				</textField>
			</band>
		</detail>
		<columnFooter>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnFooter>
		<pageFooter>
			<band height="40"  isSplitAllowed="false" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="0"
						y="0"
						width="355"
						height="40"
						key="textField-16"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" size="10"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$P{username}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="EEE, d MMM yyyy HH:mm:ss" isBlankWhenNull="false" evaluationTime="Report" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="355"
						y="0"
						width="240"
						height="40"
						key="textField-17"/>
					<box></box>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Tahoma" pdfFontName="Helvetica-Oblique" size="10" isItalic="true"/>
					</textElement>
				<textFieldExpression   class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
				</textField>
			</band>
		</pageFooter>
		<summary>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</summary>
</jasperReport>
