<?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="vw_employee_leave_c" language="groovy" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" uuid="0bbbcd4a-5e9a-41cc-9c6c-a550eb9643d7">
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="0"/>
	<style name="Title" fontName="Times New Roman" fontSize="50" isBold="true" pdfFontName="Times-Bold"/>
	<style name="SubTitle" forecolor="#736343" fontName="Arial" fontSize="18"/>
	<style name="Column header" forecolor="#666666" fontName="Arial" fontSize="12" isBold="true"/>
	<style name="Detail" fontName="Arial" fontSize="12"/>
	<style name="Row" mode="Transparent">
		<conditionalStyle>
			<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
			<style backcolor="#E6DAC3"/>
		</conditionalStyle>
	</style>
	<style name="table">
		<box>
			<pen lineWidth="1.0" lineColor="#000000"/>
		</box>
	</style>
	<style name="table_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 1">
		<box>
			<pen lineWidth="1.0" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 1_TH" mode="Opaque" backcolor="#F0F8FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 1_CH" mode="Opaque" backcolor="#BFE1FF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="table 1_TD" mode="Opaque" backcolor="#FFFFFF">
		<box>
			<pen lineWidth="0.5" lineColor="#000000"/>
		</box>
	</style>
	<style name="Crosstab Data Text" hAlign="Center"/>
	<parameter name="filterid" class="java.lang.String">
		<defaultValueExpression><![CDATA["1"]]></defaultValueExpression>
	</parameter>
	<parameter name="organd" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<parameter name="orgwhere" class="java.lang.String">
		<defaultValueExpression><![CDATA[""]]></defaultValueExpression>
	</parameter>
	<queryString>
		<![CDATA[SELECT
vw_employee_leave_types.entity_id, vw_employee_leave_types.entity_name, vw_employee_leave_types.leave_type_id,
vw_employee_leave_types.leave_type_name,
get_leave_approved_balance(vw_employee_leave_types.entity_id, vw_employee_leave_types.leave_type_id) as leave_balance
FROM vw_employee_leave_types
INNER JOIN employees ON employees.entity_id = vw_employee_leave_types.entity_id
WHERE employees.active = true

$P!{organd}

ORDER BY entity_name, leave_type_name;]]>
	</queryString>
	<field name="entity_id" class="java.lang.Integer"/>
	<field name="entity_name" class="java.lang.String"/>
	<field name="leave_type_id" class="java.lang.Integer"/>
	<field name="leave_type_name" class="java.lang.String"/>
	<field name="leave_balance" class="java.lang.Float"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="72" splitType="Stretch">
			<staticText>
				<reportElement style="Title" x="66" y="0" width="446" height="62" uuid="7025a849-efd2-4543-a0e7-d326cf437e1b"/>
				<textElement verticalAlignment="Middle">
					<font fontName="Times New Roman" size="24" pdfFontName="Times-Roman"/>
				</textElement>
				<text><![CDATA[Employee Leave Summary]]></text>
			</staticText>
		</band>
	</title>
	<pageHeader>
		<band splitType="Stretch"/>
	</pageHeader>
	<columnHeader>
		<band splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band splitType="Stretch"/>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="25" splitType="Stretch">
			<frame>
				<reportElement mode="Opaque" x="0" y="1" width="555" height="24" forecolor="#D0B48E" backcolor="#F2EBDF" uuid="b73d989f-ad1a-48da-9227-77c459d37233"/>
				<textField evaluationTime="Report">
					<reportElement style="Column header" x="511" y="0" width="40" height="20" forecolor="#736343" uuid="1d3dc82d-cddb-4b76-b621-bf56f52f4464"/>
					<textElement verticalAlignment="Middle">
						<font fontName="Times New Roman" size="10" isBold="false"/>
					</textElement>
					<textFieldExpression><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement style="Column header" x="430" y="0" width="80" height="20" forecolor="#736343" uuid="e94f6824-60db-46ef-9390-17dd5d377a07"/>
					<textElement textAlignment="Right" verticalAlignment="Middle">
						<font fontName="Times New Roman" size="10" isBold="false"/>
					</textElement>
					<textFieldExpression><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
				</textField>
				<textField pattern="EEEEE, d MMMMM yyyy HH:mm:ss Z">
					<reportElement style="Column header" x="5" y="1" width="197" height="20" forecolor="#736343" uuid="33f8424a-01cc-411f-aa1f-7308a5c75fdb"/>
					<textElement verticalAlignment="Middle">
						<font fontName="Times New Roman" size="10" isBold="false"/>
					</textElement>
					<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
				</textField>
			</frame>
		</band>
	</pageFooter>
	<summary>
		<band height="32" splitType="Stretch">
			<crosstab>
				<reportElement x="0" y="0" width="555" height="32" uuid="4ffebb62-09bf-40c8-b23f-d1db0c629b81"/>
				<rowGroup name="entity_name" width="233">
					<bucket class="java.lang.String">
						<bucketExpression><![CDATA[$F{entity_name}]]></bucketExpression>
					</bucket>
					<crosstabRowHeader>
						<cellContents backcolor="#F0F8FF" mode="Opaque">
							<box>
								<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
							</box>
							<textField>
								<reportElement style="Crosstab Data Text" x="0" y="0" width="233" height="25" uuid="47b42b67-0776-408b-baaf-19477dd13578"/>
								<textElement>
									<font fontName="Times New Roman"/>
								</textElement>
								<textFieldExpression><![CDATA[$V{entity_name}]]></textFieldExpression>
							</textField>
						</cellContents>
					</crosstabRowHeader>
					<crosstabTotalRowHeader>
						<cellContents/>
					</crosstabTotalRowHeader>
				</rowGroup>
				<columnGroup name="leave_type_name" height="30" totalPosition="End">
					<bucket class="java.lang.String">
						<bucketExpression><![CDATA[$F{leave_type_name}]]></bucketExpression>
					</bucket>
					<crosstabColumnHeader>
						<cellContents backcolor="#F0F8FF" mode="Opaque">
							<box>
								<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
							</box>
							<textField>
								<reportElement style="Crosstab Data Text" x="0" y="0" width="79" height="30" uuid="de4a4522-c2b3-442d-acc0-4cfa08996710"/>
								<textElement>
									<font fontName="Times New Roman"/>
								</textElement>
								<textFieldExpression><![CDATA[$V{leave_type_name}]]></textFieldExpression>
							</textField>
						</cellContents>
					</crosstabColumnHeader>
					<crosstabTotalColumnHeader>
						<cellContents backcolor="#BFE1FF" mode="Opaque">
							<box>
								<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
							</box>
							<staticText>
								<reportElement x="0" y="0" width="50" height="30" uuid="92efe11e-36a0-4270-8261-3174962bc601"/>
								<textElement textAlignment="Center" verticalAlignment="Middle">
									<font fontName="Times New Roman"/>
								</textElement>
								<text><![CDATA[Total]]></text>
							</staticText>
						</cellContents>
					</crosstabTotalColumnHeader>
				</columnGroup>
				<measure name="leave_balanceMeasure" class="java.lang.Float" calculation="Sum">
					<measureExpression><![CDATA[$F{leave_balance}]]></measureExpression>
				</measure>
				<crosstabCell width="79" height="25">
					<cellContents>
						<box>
							<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
						</box>
						<textField>
							<reportElement style="Crosstab Data Text" x="0" y="0" width="79" height="25" uuid="8d17cf2d-3ec2-46e9-95c1-453a1fef4a11"/>
							<textElement>
								<font fontName="Times New Roman"/>
							</textElement>
							<textFieldExpression><![CDATA[$V{leave_balanceMeasure}]]></textFieldExpression>
						</textField>
					</cellContents>
				</crosstabCell>
				<crosstabCell height="25" rowTotalGroup="entity_name">
					<cellContents backcolor="#BFE1FF" mode="Opaque">
						<box>
							<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
						</box>
						<textField>
							<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" uuid="3febd25f-3434-4745-81fe-1a6865771cca"/>
							<textFieldExpression><![CDATA[$V{leave_balanceMeasure}]]></textFieldExpression>
						</textField>
					</cellContents>
				</crosstabCell>
				<crosstabCell width="50" columnTotalGroup="leave_type_name">
					<cellContents backcolor="#BFE1FF" mode="Opaque">
						<box>
							<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
						</box>
						<textField>
							<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" uuid="9208c79c-7c39-4d3d-b18a-79ac065ca402"/>
							<textElement>
								<font fontName="Times New Roman"/>
							</textElement>
							<textFieldExpression><![CDATA[$V{leave_balanceMeasure}]]></textFieldExpression>
						</textField>
					</cellContents>
				</crosstabCell>
				<crosstabCell rowTotalGroup="entity_name" columnTotalGroup="leave_type_name">
					<cellContents backcolor="#BFE1FF" mode="Opaque">
						<box>
							<pen lineWidth="0.5" lineStyle="Solid" lineColor="#000000"/>
						</box>
						<textField>
							<reportElement style="Crosstab Data Text" x="0" y="0" width="50" height="25" uuid="23902e4f-4e0f-4e39-9d92-e37efdfa7fcf"/>
							<textFieldExpression><![CDATA[$V{leave_balanceMeasure}]]></textFieldExpression>
						</textField>
					</cellContents>
				</crosstabCell>
			</crosstab>
		</band>
	</summary>
</jasperReport>
