<?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="HorizontalListReport" pageWidth="595" pageHeight="842" columnWidth="515" leftMargin="40" rightMargin="40" topMargin="50" bottomMargin="50">
	<style name="Sans_Normal" isDefault="true" fontName="DejaVu Sans" fontSize="12" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
	<style name="Sans_Bold" isDefault="false" fontName="DejaVu Sans" fontSize="12" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
	<style name="Sans_Italic" isDefault="false" fontName="DejaVu Sans" fontSize="12" isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false"/>
	<style name="Sans_Small" isDefault="false" fontName="DejaVu Sans" fontSize="10" isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
	<style name="Sans_SmallBold" isDefault="false" fontName="DejaVu Sans" fontSize="10" isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false"/>
	<style name="ListCell"  mode="Opaque" backcolor="#fbf1da"/>
	<subDataset name="Addresses">
		<parameter name="City" class="java.lang.String">
		</parameter>
		<queryString><![CDATA[SELECT * FROM Address WHERE City = $P{City} ORDER BY LastName, FirstName]]></queryString>
		<field name="Id" class="java.lang.Integer">
		</field>
		<field name="FirstName" class="java.lang.String">
		</field>
		<field name="LastName" class="java.lang.String">
		</field>
		<field name="Street" class="java.lang.String">
		</field>
		<field name="City" class="java.lang.String">
		</field>
	</subDataset>
	<queryString><![CDATA[SELECT City FROM Address GROUP BY City ORDER BY City]]></queryString>
	<field name="City" class="java.lang.String">
	</field>
	<title>
		<band height="40">
			<line>
				<reportElement x="0" y="0" width="515" height="1"/>
				<graphicElement/>
			</line>
			<staticText>
				<reportElement x="0" y="10" width="515" height="30" style="Sans_Normal"/>
				<textElement textAlignment="Center">
					<font size="22"/>
				</textElement>
				<text><![CDATA[Addresses Report]]></text>
			</staticText>
		</band>
	</title>
	<pageHeader>
		<band height="21">
			<staticText>
				<reportElement mode="Opaque" x="0" y="5" width="515" height="15" forecolor="#ffffff" backcolor="#333333" style="Sans_Bold"/>
				<text><![CDATA[Addresses List]]></text>
			</staticText>
		</band>
	</pageHeader>
	<detail>
		<band height="65">
			<textField>
				<reportElement x="5" y="5" width="100" height="15" isPrintWhenDetailOverflows="true" style="Sans_Bold"/>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{City}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement isPrintRepeatedValues="false" x="110" y="5" width="100" height="15" isPrintWhenDetailOverflows="true" style="Sans_Bold"/>
				<text><![CDATA[(continued)]]></text>
			</staticText>
			<componentElement>
				<reportElement x="0" y="25" width="515" height="40"/>
				<c:list xmlns:c="http://jasperreports.sourceforge.net/jasperreports/components" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports/components http://jasperreports.sourceforge.net/xsd/components.xsd" printOrder="Horizontal">
					<datasetRun subDataset="Addresses">
						<datasetParameter name="City">
							<datasetParameterExpression><![CDATA[$F{City}]]></datasetParameterExpression>
						</datasetParameter>
					</datasetRun>
					<c:listContents height="40" width="128">
						<frame>
							<reportElement x="4" y="0" width="120" height="38" style="ListCell" stretchType="RelativeToBandHeight"/>
							<box>
								<topPen lineWidth=".5"/>
								<bottomPen lineWidth=".5"/>
							</box>
							<textField>
								<reportElement x="0" y="2" width="100" height="12" style="Sans_SmallBold"/>
								<textElement/>
								<textFieldExpression><![CDATA["#" + $V{REPORT_COUNT} + " - " + $F{Id}]]></textFieldExpression>
							</textField>
							<textField isStretchWithOverflow="true">
								<reportElement positionType="Float" x="10" y="14" width="110" height="12" style="Sans_Small"/>
								<textElement/>
								<textFieldExpression class="java.lang.String"><![CDATA[$F{FirstName} + " " + $F{LastName}]]></textFieldExpression>
							</textField>
							<textField isStretchWithOverflow="true">
								<reportElement positionType="Float" x="10" y="26" width="110" height="12" style="Sans_Small"/>
								<textElement/>
								<textFieldExpression class="java.lang.String"><![CDATA[$F{Street} + ", " + $F{City}]]></textFieldExpression>
							</textField>
						</frame>
					</c:listContents>
				</c:list>
			</componentElement>
		</band>
	</detail>
	<pageFooter>
		<band height="40">
			<line>
				<reportElement x="0" y="10" width="515" height="1"/>
				<graphicElement/>
			</line>
			<textField>
				<reportElement x="200" y="20" width="80" height="15"/>
				<textElement textAlignment="Right"/>
				<textFieldExpression class="java.lang.String"><![CDATA["Page " + String.valueOf($V{PAGE_NUMBER}) + " of"]]></textFieldExpression>
			</textField>
			<textField evaluationTime="Report">
				<reportElement x="280" y="20" width="75" height="15"/>
				<textElement/>
				<textFieldExpression class="java.lang.String"><![CDATA[" " + String.valueOf($V{PAGE_NUMBER})]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
</jasperReport>
