Source

habisoft / jrxml / RelatorioPorTempoDeResidencia.jrxml

Full commit
<?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="RelatorioPorTempoDeResidencia"
		 columnCount="1"
		 printOrder="Vertical"
		 orientation="Portrait"
		 pageWidth="595"
		 pageHeight="842"
		 columnWidth="539"
		 columnSpacing="0"
		 leftMargin="28"
		 rightMargin="28"
		 topMargin="14"
		 bottomMargin="14"
		 whenNoDataType="NoPages"
		 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="LOGO" isForPrompting="false" class="java.awt.Image"/>
	<parameter name="TITULO" isForPrompting="false" class="java.lang.String">
		<defaultValueExpression ><![CDATA["Relatório de Pessoas"]]></defaultValueExpression>
	</parameter>

	<field name="codigo" class="java.lang.Integer"/>
	<field name="nome" class="java.lang.String"/>
	<field name="parceiro.nome" class="java.lang.String"/>
	<field name="familia.tempoDeResidenciaAnos" class="java.lang.Integer"/>
	<field name="familia.tempoDeResidenciaMeses" class="java.lang.Integer"/>

		<background>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</background>
		<title>
			<band height="110"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						x="185"
						y="4"
						width="338"
						height="42"
						key="staticText-1"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="14" isBold="true"/>
					</textElement>
				<text><![CDATA[Prefeitura Municipal de Presidente Kennedy
Secretaria Municipal de Habitação]]></text>
				</staticText>
				<textField isStretchWithOverflow="false" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="185"
						y="46"
						width="338"
						height="61"
						key="textField-7"/>
					<box></box>
					<textElement textAlignment="Center">
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="18" isBold="true"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["Relatório de Pessoas por Tempo de Residência no Município"]]></textFieldExpression>
				</textField>
				<image  scaleImage="RetainShape" vAlign="Middle" hAlign="Center" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="4"
						y="-1"
						width="165"
						height="108"
						key="image-1"/>
					<box></box>
					<graphicElement stretchType="NoStretch"/>
					<imageExpression class="java.awt.Image"><![CDATA[$P{LOGO}]]></imageExpression>
				</image>
			</band>
		</title>
		<pageHeader>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</pageHeader>
		<columnHeader>
			<band height="24"  isSplitAllowed="true" >
				<staticText>
					<reportElement
						mode="Opaque"
						x="4"
						y="6"
						width="58"
						height="17"
						backcolor="#CCCCCC"
						key="staticText-5"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[Código]]></text>
				</staticText>
				<staticText>
					<reportElement
						mode="Opaque"
						x="53"
						y="6"
						width="161"
						height="17"
						backcolor="#CCCCCC"
						key="staticText-2"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" size="10" isBold="true"/>
					</textElement>
				<text><![CDATA[Nome da Pessoa]]></text>
				</staticText>
				<staticText>
					<reportElement
						mode="Opaque"
						x="212"
						y="6"
						width="160"
						height="17"
						backcolor="#CCCCCC"
						key="staticText-3"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[Parceiro]]></text>
				</staticText>
				<staticText>
					<reportElement
						mode="Opaque"
						x="355"
						y="6"
						width="180"
						height="17"
						backcolor="#CCCCCC"
						key="staticText-6"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma" pdfFontName="Helvetica-Bold" isBold="true"/>
					</textElement>
				<text><![CDATA[Tempo de Residência no Município]]></text>
				</staticText>
			</band>
		</columnHeader>
		<detail>
			<band height="17"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="4"
						y="2"
						width="41"
						height="15"
						key="textField-2"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[String.valueOf($F{codigo})]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="53"
						y="2"
						width="159"
						height="15"
						key="textField-3"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{nome}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="212"
						y="2"
						width="140"
						height="15"
						key="textField-4"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[$F{parceiro.nome}]]></textFieldExpression>
				</textField>
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="355"
						y="1"
						width="180"
						height="15"
						key="textField-6"/>
					<box></box>
					<textElement>
						<font fontName="Tahoma"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA[(($F{familia.tempoDeResidenciaAnos}.intValue() > 0 && $F{familia.tempoDeResidenciaMeses}.intValue() > 0) ? String.valueOf($F{familia.tempoDeResidenciaAnos}) + " anos e " + String.valueOf($F{familia.tempoDeResidenciaMeses}) + " meses." : (($F{familia.tempoDeResidenciaAnos}.intValue() > 0) ? String.valueOf($F{familia.tempoDeResidenciaAnos}) + " anos." : String.valueOf($F{familia.tempoDeResidenciaMeses}) + " meses."))]]></textFieldExpression>
				</textField>
			</band>
		</detail>
		<columnFooter>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</columnFooter>
		<pageFooter>
			<band height="20"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="394"
						y="4"
						width="143"
						height="15"
						key="textField-1"
						positionType="FixRelativeToBottom"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" size="12"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["Página" + String.valueOf($V{PAGE_NUMBER}) + " de " + String.valueOf($V{PAGE_COUNT}) + "."]]></textFieldExpression>
				</textField>
			</band>
		</pageFooter>
		<lastPageFooter>
			<band height="20"  isSplitAllowed="true" >
				<textField isStretchWithOverflow="false" pattern="" isBlankWhenNull="true" evaluationTime="Now" hyperlinkType="None"  hyperlinkTarget="Self" >
					<reportElement
						x="394"
						y="5"
						width="143"
						height="15"
						key="textField-8"
						positionType="FixRelativeToBottom"/>
					<box></box>
					<textElement textAlignment="Right">
						<font fontName="Tahoma" size="12"/>
					</textElement>
				<textFieldExpression   class="java.lang.String"><![CDATA["Página" + String.valueOf($V{PAGE_NUMBER}) + " de " + String.valueOf($V{PAGE_COUNT}) + "."]]></textFieldExpression>
				</textField>
			</band>
		</lastPageFooter>
		<summary>
			<band height="0"  isSplitAllowed="true" >
			</band>
		</summary>
</jasperReport>