<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport name="EmpDeptReport" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="30" bottomMargin="30">
	<parameter name="Title" class="java.lang.String">
	</parameter>
	<queryString><![CDATA[select e.empno
                                   , e.ename
                                   , e.job
                                   , e.mgr
                                   , to_char(e.hiredate, 'dd-mm-yyyy') hiredate
                                   , e.sal
                                   , e.comm
                                   , e.deptno                                    
                                   , d.dname
                                   , d.loc
                              from emp e
                              ,    dept d
                              where e.deptno = d.deptno
                              order by e.deptno]]></queryString>
	<field name="EMPNO" class="java.math.BigDecimal">
	</field>
	<field name="ENAME" class="java.lang.String">
	</field>
	<field name="JOB" class="java.lang.String">
	</field>
	<field name="MGR" class="java.math.BigDecimal">
	</field>
	<field name="HIREDATE" class="java.lang.String">
	</field>
	<field name="SAL" class="java.math.BigDecimal">
	</field>
	<field name="COMM" class="java.math.BigDecimal">
	</field>
	<field name="DEPTNO" class="java.math.BigDecimal">
	</field>
	<field name="DNAME" class="java.lang.String">
	</field>
	<field name="LOC" class="java.lang.String">
	</field>
	<variable name="SalSumDept" class="java.math.BigDecimal" resetType="Group" resetGroup="DeptGroup" calculation="Sum">
		<variableExpression><![CDATA[$F{SAL}]]></variableExpression>
	</variable>
	<variable name="CommSumDept" class="java.math.BigDecimal" resetType="Group" resetGroup="DeptGroup" calculation="Sum">
		<variableExpression><![CDATA[$F{COMM}]]></variableExpression>
	</variable>
	<group name="DeptGroup">
		<groupExpression><![CDATA[$F{DEPTNO}]]></groupExpression>
		<groupHeader>
		<band height="25">
			<staticText>
				<reportElement positionType="Float" mode="Opaque" x="132" y="0" width="68" height="16"/>
				<textElement/>
				<text><![CDATA[Department:]]></text>
			</staticText>
			<textField>
				<reportElement positionType="Float" mode="Opaque" x="208" y="0" width="64" height="16"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{DNAME}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement positionType="Float" mode="Opaque" x="277" y="0" width="72" height="16"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{LOC}]]></textFieldExpression>
			</textField>
		</band>
		</groupHeader>
		<groupFooter>
		<band height="25">
			<line>
				<reportElement positionType="Float" x="397" y="0" width="154" height="1"/>
				<graphicElement/>
			</line>
			<textField>
				<reportElement positionType="Float" mode="Opaque" x="388" y="3" width="60" height="16"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{SalSumDept}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement positionType="Float" mode="Opaque" x="488" y="3" width="52" height="16"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$V{CommSumDept}]]></textFieldExpression>
			</textField>
		</band>
		</groupFooter>
	</group>
	<title>
		<band height="50">
			<textField>
				<reportElement positionType="Float" x="0" y="0" width="842" height="50"/>
				<textElement>
					<font size="16" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{Title}]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band>
		</band>
	</pageHeader>
	<columnHeader>
		<band height="20">
			<staticText>
				<reportElement positionType="Float" x="0" y="0" width="55" height="20"/>
				<textElement>
					<font isUnderline="true"/>
				</textElement>
				<text><![CDATA[EMPNO]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" x="55" y="0" width="55" height="20"/>
				<textElement>
					<font isUnderline="true"/>
				</textElement>
				<text><![CDATA[ENAME]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" x="144" y="0" width="72" height="20"/>
				<textElement>
					<font isUnderline="true"/>
				</textElement>
				<text><![CDATA[JOB]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" x="244" y="0" width="52" height="20"/>
				<textElement>
					<font isUnderline="true"/>
				</textElement>
				<text><![CDATA[MGR]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" x="324" y="0" width="53" height="20"/>
				<textElement>
					<font isUnderline="true"/>
				</textElement>
				<text><![CDATA[HIREDATE]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Opaque" x="395" y="0" width="53" height="20"/>
				<textElement textAlignment="Right">
					<font isUnderline="true"/>
				</textElement>
				<text><![CDATA[SAL]]></text>
			</staticText>
			<staticText>
				<reportElement positionType="Float" mode="Opaque" x="491" y="0" width="54" height="20"/>
				<textElement textAlignment="Right">
					<font isUnderline="true"/>
				</textElement>
				<text><![CDATA[COMM]]></text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="24">
			<textField>
				<reportElement positionType="Float" x="0" y="1" width="52" height="20"/>
				<textElement/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{EMPNO}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement positionType="Float" x="55" y="0" width="55" height="20"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{ENAME}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement positionType="Float" x="144" y="0" width="72" height="20"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{JOB}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement positionType="Float" mode="Opaque" x="244" y="0" width="52" height="20"/>
				<textElement/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{MGR}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement positionType="Float" mode="Opaque" x="324" y="0" width="53" height="20"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{HIREDATE}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement positionType="Float" mode="Opaque" x="395" y="0" width="53" height="20"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{SAL}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement positionType="Float" mode="Opaque" x="491" y="0" width="54" height="20"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression class="java.math.BigDecimal"><![CDATA[$F{COMM}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band>
		</band>
	</columnFooter>
	<pageFooter>
		<band height="15">
			<staticText>
				<reportElement positionType="Float" x="0" y="0" width="40" height="15"/>
				<textElement/>
				<text><![CDATA[Page:]]></text>
			</staticText>
			<textField>
				<reportElement positionType="Float" x="40" y="0" width="100" height="15"/>
				<textElement/>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<summary>
		<band>
		</band>
	</summary>
</jasperReport>

