<?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="reportName" language="groovy" pageWidth="842" pageHeight="595" orientation="Landscape" whenNoDataType="NoDataSection" columnWidth="782" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" isSummaryNewPage="true" isSummaryWithPageHeaderAndFooter="true">
	<property name="ireport.scriptlethandling" value="0"/>
	<property name="ireport.encoding" value="UTF-8"/>
	<property name="ireport.zoom" value="1.0"/>
	<property name="ireport.x" value="0"/>
	<property name="ireport.y" value="1109"/>
	<import value="net.sf.jasperreports.engine.*"/>
	<import value="java.util.*"/>
	<import value="net.sf.jasperreports.engine.data.*"/>
	<style name="Crosstab Data Text" isDefault="false" hAlign="Center"/>
	<style name="table" isDefault="false" fill="Solid" fontSize="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false">
		<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
			<pen lineWidth="0.0" lineColor="#000000"/>
			<topPen lineWidth="0.0"/>
			<leftPen lineWidth="0.0"/>
			<bottomPen lineWidth="0.0"/>
			<rightPen lineWidth="0.0"/>
		</box>
	</style>
	<style name="table_TH" isDefault="false" mode="Opaque" backcolor="#C7C7C7" fontSize="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false">
		<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
			<pen lineWidth="1.0" lineColor="#000000"/>
			<topPen lineWidth="1.0"/>
			<leftPen lineWidth="0.0"/>
			<bottomPen lineWidth="1.0"/>
			<rightPen lineWidth="0.0"/>
		</box>
	</style>
	<style name="table_CH" isDefault="false" mode="Opaque" backcolor="#FFFFFF" fontSize="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false">
		<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
			<pen lineWidth="1.0" lineColor="#000000"/>
			<topPen lineWidth="0.0"/>
			<leftPen lineWidth="0.0"/>
			<bottomPen lineWidth="1.0"/>
			<rightPen lineWidth="0.0"/>
		</box>
	</style>
	<style name="table_TD" isDefault="false" mode="Opaque" backcolor="#FFFFFF" fontSize="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false">
		<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
			<pen lineWidth="1.0" lineColor="#000000"/>
			<topPen lineWidth="1.0"/>
			<leftPen lineWidth="0.0"/>
			<bottomPen lineWidth="1.0"/>
			<rightPen lineWidth="0.0"/>
		</box>
		<conditionalStyle>
			<conditionExpression><![CDATA[new Boolean($V{REPORT_COUNT}.intValue()%2==0)]]></conditionExpression>
			<style isDefault="false" style="table_TD" backcolor="#F7F7F7"/>
		</conditionalStyle>
	</style>
	<style name="table_CF" isDefault="false" mode="Opaque" backcolor="#EDEDED" fontSize="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false">
		<box topPadding="0" leftPadding="0" bottomPadding="0" rightPadding="0">
			<pen lineWidth="1.0"/>
			<topPen lineWidth="1.0"/>
			<leftPen lineWidth="0.0"/>
			<bottomPen lineWidth="1.0"/>
			<rightPen lineWidth="0.0"/>
		</box>
	</style>
	<subDataset name="dataset1">
		<field name="id" class="java.lang.Long"/>
		<field name="name" class="java.lang.String"/>
		<field name="immediateCalloutCount" class="java.lang.Integer"/>
		<field name="downTime" class="java.lang.Integer"/>
		<field name="tasks" class="java.lang.String"/>
		<variable name="immediateCalloutSum" class="java.lang.Integer" calculation="Sum">
			<variableExpression><![CDATA[$F{immediateCalloutCount}]]></variableExpression>
		</variable>
		<variable name="downTimeSum" class="java.lang.Integer" calculation="Sum">
			<variableExpression><![CDATA[$F{downTime}]]></variableExpression>
		</variable>
		<group name="assetName">
			<groupExpression><![CDATA[$F{name}]]></groupExpression>
		</group>
	</subDataset>
	<parameter name="reportTitle" class="java.lang.String"/>
	<parameter name="currentUser" class="java.lang.String"/>
	<parameter name="logoUrl" class="java.lang.String"/>
	<parameter name="startDateString" class="java.lang.String"/>
	<parameter name="endDateString" class="java.lang.String"/>
	<queryString language="SQL">
		<![CDATA[]]>
	</queryString>
	<field name="taskList" class="java.util.List"/>
	<field name="summaryOfCalculationMethod" class="java.lang.String"/>
	<field name="totalAssetsOnTasksCount" class="java.lang.String"/>
	<field name="assetList" class="java.util.List"/>
	<field name="totalDownTime" class="java.util.LinkedHashMap"/>
	<background>
		<band splitType="Stretch"/>
	</background>
	<pageHeader>
		<band height="121" splitType="Stretch">
			<textField>
				<reportElement key="staticText-1" x="0" y="57" width="340" height="30"/>
				<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
					<font fontName="Serif" size="20"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{reportTitle}]]></textFieldExpression>
			</textField>
			<image>
				<reportElement x="0" y="0" width="340" height="57"/>
				<imageExpression class="java.net.URL"><![CDATA[new URL($P{logoUrl})]]></imageExpression>
			</image>
			<textField pattern="dd-MMM-yyyy" isBlankWhenNull="true">
				<reportElement x="0" y="87" width="340" height="20"/>
				<textElement textAlignment="Center" verticalAlignment="Middle" markup="none">
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{startDateString}+" to "+$P{endDateString}]]></textFieldExpression>
			</textField>
		</band>
	</pageHeader>
	<columnHeader>
		<band splitType="Stretch"/>
	</columnHeader>
	<detail>
		<band height="394" splitType="Stretch">
			<bar3DChart>
				<chart>
					<reportElement x="0" y="0" width="782" height="394"/>
					<chartTitle position="Bottom">
						<font isUnderline="false"/>
						<titleExpression><![CDATA["Total: "+$F{totalAssetsOnTasksCount}]]></titleExpression>
					</chartTitle>
					<chartSubtitle/>
					<chartLegend/>
				</chart>
				<categoryDataset>
					<dataset>
						<datasetRun subDataset="dataset1">
							<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{assetList})]]></dataSourceExpression>
						</datasetRun>
					</dataset>
					<categorySeries>
						<seriesExpression><![CDATA["Immediate Callouts"]]></seriesExpression>
						<categoryExpression><![CDATA[$F{name}]]></categoryExpression>
						<valueExpression><![CDATA[$F{immediateCalloutCount}]]></valueExpression>
					</categorySeries>
				</categoryDataset>
				<bar3DPlot isShowLabels="true">
					<plot labelRotation="-60.0"/>
					<itemLabel color="#000000" backgroundColor="#FFFFFF"/>
					<categoryAxisFormat labelRotation="-60.0">
						<axisFormat>
							<labelFont/>
							<tickLabelFont/>
						</axisFormat>
					</categoryAxisFormat>
					<valueAxisFormat>
						<axisFormat>
							<labelFont/>
							<tickLabelFont/>
						</axisFormat>
					</valueAxisFormat>
				</bar3DPlot>
			</bar3DChart>
		</band>
		<band height="394">
			<bar3DChart>
				<chart>
					<reportElement x="0" y="0" width="782" height="394"/>
					<chartTitle position="Bottom">
						<font isBold="false" isUnderline="false"/>
						<titleExpression><![CDATA["Total: "+$F{totalDownTime}.total+"min"+" ("+$F{totalDownTime}.hours+"h:"+$F{totalDownTime}.minutes+"m)"]]></titleExpression>
					</chartTitle>
					<chartSubtitle/>
					<chartLegend position="Bottom">
						<font isUnderline="true"/>
					</chartLegend>
				</chart>
				<categoryDataset>
					<dataset>
						<datasetRun subDataset="dataset1">
							<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{assetList})]]></dataSourceExpression>
						</datasetRun>
					</dataset>
					<categorySeries>
						<seriesExpression><![CDATA["Down Time (min)"]]></seriesExpression>
						<categoryExpression><![CDATA[$F{name}]]></categoryExpression>
						<valueExpression><![CDATA[$F{downTime}]]></valueExpression>
					</categorySeries>
				</categoryDataset>
				<bar3DPlot isShowLabels="true">
					<plot labelRotation="-60.0">
						<seriesColor seriesOrder="0" color="#FF9900"/>
					</plot>
					<itemLabel color="#000000" backgroundColor="#FFFFFF"/>
					<categoryAxisFormat labelRotation="-60.0">
						<axisFormat>
							<labelFont/>
							<tickLabelFont/>
						</axisFormat>
					</categoryAxisFormat>
					<valueAxisFormat>
						<axisFormat>
							<labelFont/>
							<tickLabelFont/>
						</axisFormat>
					</valueAxisFormat>
				</bar3DPlot>
			</bar3DChart>
		</band>
		<band height="394">
			<componentElement>
				<reportElement key="table 1" style="table" x="0" y="0" width="782" height="394"/>
				<jr:table xmlns:jr="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd">
					<datasetRun subDataset="dataset1">
						<dataSourceExpression><![CDATA[new net.sf.jasperreports.engine.data.JRBeanCollectionDataSource($F{assetList})]]></dataSourceExpression>
					</datasetRun>
					<jr:column width="774">
						<jr:groupHeader groupName="assetName">
							<jr:cell height="30" rowSpan="1">
								<textField>
									<reportElement x="0" y="0" width="774" height="30"/>
									<textElement verticalAlignment="Middle">
										<font size="12" isBold="true"/>
									</textElement>
									<textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression>
								</textField>
							</jr:cell>
						</jr:groupHeader>
						<jr:detailCell style="table_TD" height="40" rowSpan="1">
							<textField isStretchWithOverflow="true">
								<reportElement x="0" y="0" width="774" height="40"/>
								<textElement verticalAlignment="Middle"/>
								<textFieldExpression class="java.lang.String"><![CDATA[""+$F{tasks}]]></textFieldExpression>
							</textField>
						</jr:detailCell>
					</jr:column>
				</jr:table>
			</componentElement>
		</band>
	</detail>
	<columnFooter>
		<band splitType="Stretch"/>
	</columnFooter>
	<pageFooter>
		<band height="40" splitType="Stretch">
			<textField pattern="dd-MMM-yyyy">
				<reportElement x="82" y="0" width="200" height="20"/>
				<textElement>
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="662" y="20" width="80" height="20"/>
				<textElement textAlignment="Right">
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report">
				<reportElement x="742" y="20" width="40" height="20"/>
				<textElement>
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="0" width="82" height="20"/>
				<textElement markup="none">
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Generated: "]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="82" y="20" width="200" height="20"/>
				<textElement markup="none">
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{currentUser}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="20" width="82" height="20"/>
				<textElement markup="none">
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["By: "]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<lastPageFooter>
		<band height="40">
			<textField evaluationTime="Report">
				<reportElement x="742" y="20" width="40" height="20"/>
				<textElement>
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[" " + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField pattern="dd-MMM-yyyy">
				<reportElement x="82" y="0" width="200" height="20"/>
				<textElement>
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="0" width="82" height="20"/>
				<textElement markup="none">
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Generated: "]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="20" width="82" height="20"/>
				<textElement markup="none">
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["By: "]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="82" y="20" width="200" height="20"/>
				<textElement markup="none">
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{currentUser}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="662" y="20" width="80" height="20"/>
				<textElement textAlignment="Right">
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Page "+$V{PAGE_NUMBER}+" of"]]></textFieldExpression>
			</textField>
		</band>
	</lastPageFooter>
	<summary>
		<band height="369">
			<textField>
				<reportElement key="staticText-1" x="221" y="12" width="340" height="30"/>
				<textElement textAlignment="Center" verticalAlignment="Top" markup="none">
					<font fontName="Serif" size="20"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Summary of Calculation Method"]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement x="0" y="50" width="782" height="311"/>
				<textElement>
					<font fontName="Serif"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{summaryOfCalculationMethod}]]></textFieldExpression>
			</textField>
		</band>
	</summary>
	<noData>
		<band height="85" splitType="Stretch">
			<textField>
				<reportElement x="0" y="35" width="782" height="50"/>
				<textElement textAlignment="Center" markup="none">
					<font fontName="Serif" size="14" isBold="true"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["No data to display. \n"+
"Please run report again."]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement key="staticText-1" x="0" y="0" width="782" height="35"/>
				<textElement textAlignment="Center" markup="none">
					<font fontName="Serif" size="20"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{reportTitle}]]></textFieldExpression>
			</textField>
		</band>
	</noData>
</jasperReport>
