<?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="RelatorioEmpresaCorrida" pageWidth="595" pageHeight="842" whenNoDataType="NoDataSection" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20" resourceBundle="RelatorioEmpresaCorrida" whenResourceMissingType="Empty" uuid="94834362-0ecc-46da-b0a2-5cdee355da3e">
	<property name="net.sf.jasperreports.export.xls.exclude.origin.band.1" value="title"/>
	<property name="net.sf.jasperreports.export.pdf.exclude.origin.band.2" value="columnHeader"/>
	<property name="net.sf.jasperreports.export.xls.exclude.origin.keep.first.band.1" value="columnHeader"/>
	<property name="net.sf.jasperreports.export.xls.exclude.origin.band.3" value="groupHeader"/>
	<property name="net.sf.jasperreports.export.xls.exclude.origin.group.3" value="empresa"/>
	<property name="net.sf.jasperreports.export.xls.exclude.origin.band.4" value="groupFooter"/>
	<property name="net.sf.jasperreports.export.xls.exclude.origin.group.4" value="empresa"/>
    <property name="net.sf.jasperreports.export.xls.exclude.origin.band.5" value="groupHeader"/>
	<property name="net.sf.jasperreports.export.xls.exclude.origin.group.5" value="autobus"/>
	<property name="net.sf.jasperreports.export.xls.exclude.origin.band.6" value="groupFooter"/>
	<property name="net.sf.jasperreports.export.xls.exclude.origin.group.6" value="autobus"/>
	<property name="ireport.zoom" value="1.996500000000005"/>
	<property name="ireport.x" value="87"/>
	<property name="ireport.y" value="0"/>
	<parameter name="fecInicio" class="java.lang.String">
		<defaultValueExpression><![CDATA[]]></defaultValueExpression>
	</parameter>
	<parameter name="NOMBEMPRESA" class="java.lang.String"/>
	<parameter name="fecFinal" class="java.lang.String"/>
	<parameter name="USUARIO_ID" class="java.lang.String"/>
	<parameter name="LINHA_FILTRO" class="java.lang.String"/>
	<parameter name="SERVICO_FILTRO" class="java.lang.String"/>
	<parameter name="TITULO" class="java.lang.String"/>
	<queryString>
		<![CDATA[]]>
	</queryString>
	<field name="dia" class="java.util.Date"/>
	<field name="coche" class="java.lang.Integer"/>
	<field name="origem" class="java.lang.String"/>
	<field name="destino" class="java.lang.String"/>
	<field name="hora" class="java.lang.String"/>
	<field name="kmts" class="java.lang.Integer"/>
	<field name="empresa" class="java.lang.String"/>
	<field name="corridaId" class="java.lang.Integer"/>
	<variable name="sum.kmts" class="java.lang.Integer" resetType="Group" resetGroup="empresa" calculation="Sum">
		<variableExpression><![CDATA[$F{kmts}]]></variableExpression>
	</variable>
	<variable name="total.corridas" class="java.lang.Integer" resetType="Group" resetGroup="autobus" calculation="Count">
		<variableExpression><![CDATA[$F{corridaId}]]></variableExpression>
	</variable>
	<variable name="subtotal.kms" class="java.lang.Integer" resetType="Group" resetGroup="autobus" calculation="Sum">
		<variableExpression><![CDATA[$F{kmts}]]></variableExpression>
	</variable>
	<group name="empresa">
		<groupExpression><![CDATA[$F{empresa}]]></groupExpression>
		<groupHeader>
			<band height="36">
				<textField>
					<reportElement uuid="09306494-79f1-44dd-9eed-c39684384bbf" x="0" y="0" width="555" height="20"/>
					<textElement>
						<font size="12" isBold="true"/>
					</textElement>
					<textFieldExpression><![CDATA[$F{empresa}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement uuid="e8355048-a037-4837-866b-e6cf7a3e90ed" x="122" y="20" width="56" height="15"/>
					<textElement markup="none">
						<font size="10"/>
					</textElement>
					<textFieldExpression><![CDATA[$R{detail.coche}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement uuid="edd89ef1-92d6-4b5f-b249-851532fad9df" x="373" y="20" width="37" height="15"/>
					<textElement markup="none">
						<font size="10"/>
					</textElement>
					<textFieldExpression><![CDATA[$R{detail.hora}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement uuid="73c02335-4bbe-44ba-9c73-1201ed6b3967" x="410" y="20" width="47" height="15"/>
					<textElement markup="none">
						<font size="10"/>
					</textElement>
					<textFieldExpression><![CDATA[$R{detail.kmts}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement uuid="d88253ec-b6d4-4e99-b677-3c1a0b273a81" x="61" y="20" width="61" height="15"/>
					<textElement markup="none">
						<font size="10"/>
					</textElement>
					<textFieldExpression><![CDATA[$R{detail.dia}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement uuid="569add1e-cb73-4278-b800-fa44631527f6" x="274" y="20" width="99" height="15"/>
					<textElement markup="none">
						<font size="10"/>
					</textElement>
					<textFieldExpression><![CDATA[$R{detail.destino}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement uuid="31387dbf-1cdc-4c27-992f-2e439abea576" x="178" y="20" width="96" height="15"/>
					<textElement markup="none">
						<font size="10"/>
					</textElement>
					<textFieldExpression><![CDATA[$R{detail.origen}]]></textFieldExpression>
				</textField>
				<textField>
					<reportElement uuid="12ef050d-3938-4dd6-8e82-bfeca7adaa2a" x="0" y="20" width="61" height="15"/>
					<textElement markup="none">
						<font size="10"/>
					</textElement>
					<textFieldExpression><![CDATA[$R{detail.corridaId}]]></textFieldExpression>
				</textField>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="19">
				<textField isBlankWhenNull="true">
					<reportElement uuid="96095298-1c13-4089-8a8b-fd324b377e45" x="410" y="1" width="57" height="16"/>
					<textElement textAlignment="Left">
						<font size="10"/>
					</textElement>
					<textFieldExpression><![CDATA[$V{sum.kmts}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement uuid="1b8e90f1-09d3-4419-8d8b-a917b3b1f414" x="373" y="1" width="37" height="16"/>
					<textElement/>
					<text><![CDATA[Total]]></text>
				</staticText>
				<line>
					<reportElement uuid="6cef9de7-7dee-488b-aea7-3d02a8e3634a" x="0" y="0" width="555" height="1"/>
				</line>
			</band>
		</groupFooter>
	</group>
	<group name="autobus">
		<groupExpression><![CDATA[$F{coche}]]></groupExpression>
		<groupHeader>
			<band/>
		</groupHeader>
		<groupFooter>
			<band height="22">
				<textField>
					<reportElement uuid="ae64a3e5-8360-417b-8fa4-16d5a66c1b96" x="22" y="1" width="166" height="20"/>
					<textElement/>
					<textFieldExpression><![CDATA["Total de corridas: " + $V{total.corridas}]]></textFieldExpression>
				</textField>
				<line>
					<reportElement uuid="6a0541e8-fb81-4e9e-a852-8e09b70a1972" x="0" y="0" width="555" height="1"/>
				</line>
				<textField>
					<reportElement uuid="a6bd723a-1106-4eb0-9140-1ecfff33cfc9" x="287" y="1" width="180" height="20"/>
					<textElement/>
					<textFieldExpression><![CDATA["Subtotal Kms: " + $V{subtotal.kms}]]></textFieldExpression>
				</textField>
			</band>
		</groupFooter>
	</group>
	<background>
		<band splitType="Stretch"/>
	</background>
	<title>
		<band height="43">
			<textField>
				<reportElement uuid="e5d4714c-07cc-42ff-a7a8-76d6f6d3e716" x="0" y="20" width="49" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$R{header.periodo}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="66b2d0f6-2bf1-4bc7-9ec0-a34444e04d60" x="401" y="0" width="56" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$R{header.data.hora}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="be1692e9-f130-4d08-9173-6ca3e4699030" x="446" y="20" width="77" height="20"/>
				<textElement textAlignment="Right">
					<paragraph rightIndent="2"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{header.pagina}+" "+$V{PAGE_NUMBER}+" de "]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="652312bd-292a-424d-a234-5f157e3699c6" x="0" y="0" width="401" height="20"/>
				<textElement>
					<font isBold="true"/>
				</textElement>
				<textFieldExpression><![CDATA[$P{TITULO}]]></textFieldExpression>
			</textField>
			<textField pattern="dd/MM/yyyy HH:mm">
				<reportElement uuid="6f671365-868e-41a6-81ee-a308d1d91e1d" x="457" y="0" width="98" height="20"/>
				<textElement textAlignment="Left"/>
				<textFieldExpression><![CDATA[new java.util.Date()]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="4914d9e7-6ce8-4512-b1f8-13f3b572ac50" x="49" y="20" width="397" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$P{fecInicio} + " à " + $P{fecFinal}]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report">
				<reportElement uuid="48be49ee-ffce-4682-9665-36b6dfc42aa1" x="523" y="20" width="32" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<columnHeader>
		<band height="15">
			<textField>
				<reportElement uuid="d8429086-6e4f-48a8-a4bb-576c11523e63" x="274" y="0" width="99" height="15"/>
				<textElement markup="none">
					<font size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{detail.destino}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="162d7dfb-a31b-4868-858d-44162b179e1b" x="178" y="0" width="96" height="15"/>
				<textElement markup="none">
					<font size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{detail.origen}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="bb9f9d1b-e8ab-4ff8-998e-55f3b30080c1" x="373" y="0" width="37" height="15"/>
				<textElement markup="none">
					<font size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{detail.hora}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="e01d5d45-4dfa-487d-b651-7784ca778751" x="410" y="0" width="47" height="15"/>
				<textElement markup="none">
					<font size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{detail.kmts}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="ba7d2f98-4217-4ec5-8ff5-e710ffb5ace1" x="0" y="0" width="61" height="15"/>
				<textElement markup="none">
					<font size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{detail.corridaId}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="9c3e6387-0056-4acb-bfa1-d5609bff601f" x="122" y="0" width="56" height="15"/>
				<textElement markup="none">
					<font size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{detail.coche}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="e2955b84-e935-4a06-8b50-d8a6c1a0f792" x="61" y="0" width="61" height="15"/>
				<textElement markup="none">
					<font size="10"/>
				</textElement>
				<textFieldExpression><![CDATA[$R{detail.dia}]]></textFieldExpression>
			</textField>
		</band>
	</columnHeader>
	<detail>
		<band height="17" splitType="Stretch">
			<textField>
				<reportElement uuid="c29b2244-5b3e-48a2-9adf-8e10ee2a3856" x="178" y="0" width="96" height="16"/>
				<textElement textAlignment="Left">
					<font size="9"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{origem}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement uuid="3111776a-f727-4313-841c-55dabd804df4" x="373" y="0" width="37" height="16"/>
				<textElement textAlignment="Left">
					<font size="9"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{hora}]]></textFieldExpression>
			</textField>
			<textField>
				<reportElement uuid="3343aea7-212b-4bd5-a29c-8dcab3cb7568" x="122" y="0" width="56" height="16"/>
				<textElement textAlignment="Left">
					<font size="9"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{coche}]]></textFieldExpression>
			</textField>
			<textField pattern="dd/MM/yyyy" isBlankWhenNull="true">
				<reportElement uuid="b36dbddb-2fa9-48a5-809e-0e15ad54c529" x="61" y="0" width="61" height="16"/>
				<textElement textAlignment="Left">
					<font size="9"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{dia}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement uuid="4a68f71a-7be1-467a-b3eb-641a0c1f9a48" x="410" y="0" width="47" height="16"/>
				<textElement textAlignment="Left">
					<font size="9"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{kmts}]]></textFieldExpression>
			</textField>
			<textField isBlankWhenNull="true">
				<reportElement uuid="cee727cd-cbc7-41d0-8020-d70aa33d8c9f" x="274" y="0" width="99" height="16"/>
				<textElement textAlignment="Left">
					<font size="9"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{destino}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="true">
				<reportElement uuid="9f731da4-307a-4409-a8d5-28b2c4c40fce" x="0" y="0" width="61" height="16"/>
				<textElement textAlignment="Left">
					<font size="9"/>
				</textElement>
				<textFieldExpression><![CDATA[$F{corridaId}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<noData>
		<band height="20">
			<textField>
				<reportElement uuid="5a6c1b7b-2242-4cf1-b957-723b906ee620" x="0" y="0" width="803" height="20"/>
				<textElement/>
				<textFieldExpression><![CDATA[$R{msg.noData}]]></textFieldExpression>
			</textField>
		</band>
	</noData>
</jasperReport>
