<?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="TextReport" pageWidth="798" pageHeight="1000" whenNoDataType="AllSectionsNoDetail" columnWidth="714" leftMargin="42" rightMargin="42" topMargin="70" bottomMargin="70">
	<property name="ireport.scriptlethandling" value="0"/>
	<property name="net.sf.jasperreports.export.text.character.width" value="7.238"/>
	<property name="net.sf.jasperreports.export.text.character.height" value="13.948"/>
	<import value="net.sf.jasperreports.engine.*"/>
	<import value="java.util.*"/>
	<import value="net.sf.jasperreports.engine.data.*"/>
	<style name="FixSizeFontStyle" isDefault="true" fontName="DejaVu Sans Mono" fontSize="12"/>
	<parameter name="ReportTitle" class="java.lang.String"/>
	<parameter name="FilterClause" class="java.lang.String"/>
	<parameter name="OrderClause" class="java.lang.String"/>
	<queryString>
		<![CDATA[SELECT * FROM Address WHERE City NOT IN ( $P!{FilterClause} ) ORDER BY $P!{OrderClause}]]>
	</queryString>
	<field name="Id" class="java.lang.Integer"/>
	<field name="FirstName" class="java.lang.String"/>
	<field name="LastName" class="java.lang.String"/>
	<field name="Street" class="java.lang.String"/>
	<field name="City" class="java.lang.String"/>
	<variable name="CityNumber" class="java.lang.Integer" resetType="Group" resetGroup="CityGroup" calculation="System">
		<initialValueExpression><![CDATA[($V{CityNumber} != null)?(Integer.valueOf($V{CityNumber}.intValue() + 1)):(Integer.valueOf(1))]]></initialValueExpression>
	</variable>
	<group name="CityGroup" minHeightToStartNewPage="60">
		<groupExpression><![CDATA[$F{City}]]></groupExpression>
		<groupHeader>
			<band height="14">
				<textField pattern="" isBlankWhenNull="false">
					<reportElement key="textField" x="0" y="0" width="714" height="14"/>
					<textElement textAlignment="Left"/>
					<textFieldExpression class="java.lang.String"><![CDATA["  " + String.valueOf($V{CityNumber}) + ". " + String.valueOf($F{City})]]></textFieldExpression>
				</textField>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="14">
				<staticText>
					<reportElement key="staticText" x="500" y="0" width="70" height="14"/>
					<textElement textAlignment="Right"/>
					<text><![CDATA[Count : ]]></text>
				</staticText>
				<textField pattern="" isBlankWhenNull="false">
					<reportElement key="textField" x="570" y="0" width="28" height="14"/>
					<textElement textAlignment="Right"/>
					<textFieldExpression class="java.lang.Integer"><![CDATA[$V{CityGroup_COUNT}]]></textFieldExpression>
				</textField>
			</band>
		</groupFooter>
	</group>
	<background>
		<band/>
	</background>
	<title>
		<band height="42">
			<textField pattern="" isBlankWhenNull="true">
				<reportElement key="textField" x="0" y="0" width="760" height="42"/>
				<textElement textAlignment="Center" verticalAlignment="Middle"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$P{ReportTitle}]]></textFieldExpression>
			</textField>
		</band>
	</title>
	<pageHeader>
		<band height="14">
			<staticText>
				<reportElement key="staticText" x="20" y="0" width="20" height="14"/>
				<textElement textAlignment="Center"/>
				<text><![CDATA[ID]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText" x="80" y="0" width="80" height="14"/>
				<textElement textAlignment="Left"/>
				<text><![CDATA[Name]]></text>
			</staticText>
			<staticText>
				<reportElement key="staticText" x="368" y="0" width="60" height="14"/>
				<textElement textAlignment="Left"/>
				<text><![CDATA[Street]]></text>
			</staticText>
		</band>
	</pageHeader>
	<columnHeader>
		<band/>
	</columnHeader>
	<detail>
		<band height="14">
			<textField isBlankWhenNull="false">
				<reportElement key="textField" x="0" y="0" width="72" height="14"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression class="java.lang.Integer"><![CDATA[$F{Id}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="false">
				<reportElement key="textField" positionType="Float" x="80" y="0" width="280" height="14"/>
				<textElement textAlignment="Left"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{FirstName} + " " + $F{LastName}]]></textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true" isBlankWhenNull="false">
				<reportElement key="textField" positionType="Float" x="368" y="0" width="348" height="14"/>
				<textElement textAlignment="Left"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{Street}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band/>
	</columnFooter>
	<pageFooter>
		<band height="28">
			<textField isBlankWhenNull="false">
				<reportElement key="textField" x="310" y="0" width="100" height="14"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression class="java.lang.String"><![CDATA["Page " + String.valueOf($V{PAGE_NUMBER}) + " of"]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report" isBlankWhenNull="false">
				<reportElement key="textField" x="410" y="0" width="40" height="14"/>
				<textElement textAlignment="Left"/>
				<textFieldExpression class="java.lang.String"><![CDATA[" " + String.valueOf($V{PAGE_NUMBER})]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<summary>
		<band height="28">
			<textField isStretchWithOverflow="true" isBlankWhenNull="false">
				<reportElement key="textField" x="290" y="0" width="180" height="14"/>
				<textElement textAlignment="Center"/>
				<textFieldExpression class="java.lang.String"><![CDATA["There were " + String.valueOf($V{REPORT_COUNT}) + " address records on this report."]]></textFieldExpression>
			</textField>
		</band>
	</summary>
</jasperReport>
