<jasperReport name="QueryReport" language="java" pageWidth="595" pageHeight="842" whenNoDataType="AllSectionsNoDetail" columnWidth="515" leftMargin="40" rightMargin="40" topMargin="50" bottomMargin="50" uuid="347ebd82-2741-4ae4-9312-31cd4e70b4b2">
	<property name="net.sf.jasperreports.export.pdf.odd.page.offset.x" value="10"/>
	<property name="net.sf.jasperreports.export.pdf.even.page.offset.x" value="-10"/>
	<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>
	<template><![CDATA["ReportStyles.jrtx"]]></template>
	<parameter name="ReportTitle" class="java.lang.String">
		<defaultValueExpression><![CDATA["Address Report"]]></defaultValueExpression>
	</parameter>
	<parameter name="ExcludedCities" class="java.util.Collection">
		<defaultValueExpression><![CDATA[Arrays.asList("Boston","Chicago","Oslo")]]></defaultValueExpression>
	</parameter>
	<parameter name="OrderClause" class="java.lang.String">
		<defaultValueExpression><![CDATA["City"]]></defaultValueExpression>
	</parameter>
	<query language="sql"><![CDATA[SELECT Id, FirstName, LastName, Street, City, (Id < 30) as ConditionalField FROM Address WHERE $X{NOTIN, City, ExcludedCities} ORDER BY $P!{OrderClause}]]></query>
	<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"/>
	<field name="ConditionalField" class="java.lang.Boolean"/>
	<variable name="CityNumber" resetType="Group" calculation="System" resetGroup="CityGroup" class="java.lang.Integer">
		<initialValueExpression><![CDATA[$V{CityNumber} == null ? 1 : ($V{CityNumber} + 1)]]></initialValueExpression>
	</variable>
	<variable name="ConditionalRow" resetType="Group" resetGroup="CityGroup" class="java.lang.Boolean">
		<expression><![CDATA[$V{CityGroup_COUNT} % 2 == 0]]></expression>
		<initialValueExpression><![CDATA[null]]></initialValueExpression>
	</variable>
	<group name="CityGroup" minHeightToStartNewPage="60">
		<expression><![CDATA[$F{City}]]></expression>
		<groupHeader>
			<band height="20">
				<element kind="textField" uuid="06942b50-23ea-4ac0-b661-26f6bbea8932" mode="Opaque" x="0" y="4" width="515" height="16" backcolor="#C0C0C0" hTextAlign="Left" style="Sans_Bold">
					<expression><![CDATA["  " + String.valueOf($V{CityNumber}) + ". " + String.valueOf($F{City})]]></expression>
					<box style="Sans_Bold">
						<bottomPen lineWidth="1.0"/>
					</box>
				</element>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="20">
				<element kind="line" uuid="79e1872d-2698-4f1d-beb5-22beb511d4b1" x="0" y="-1" width="515" height="1"/>
				<element kind="staticText" uuid="3191057f-3a04-4745-8dae-18c7115384aa" x="400" y="0" width="60" height="15" hTextAlign="Right" style="Sans_Bold">
					<paragraph lineSpacing="Single" style="Sans_Bold"/>
					<text><![CDATA[Count : ]]></text>
				</element>
				<element kind="textField" uuid="249d6c67-5498-41fa-ae87-fedef4979980" x="460" y="0" width="30" height="15" hTextAlign="Right" style="Sans_Bold">
					<paragraph lineSpacing="Single" style="Sans_Bold"/>
					<expression><![CDATA[$V{CityGroup_COUNT}]]></expression>
				</element>
			</band>
		</groupFooter>
	</group>
	<background height="742">
		<element kind="image" uuid="dfbfd9d7-e0db-4480-8ba1-1c380fcbd07e" x="0" y="0" width="150" height="742" scaleImage="Clip" hImageAlign="Left" vImageAlign="Bottom">
			<expression><![CDATA["jr.watermark.gif"]]></expression>
		</element>
	</background>
	<title height="50">
		<element kind="line" uuid="ac7d6df3-0eb6-4f79-9585-1732142d717f" x="0" y="0" width="515" height="1" forecolor="#000000"/>
		<element kind="textField" uuid="f4319415-6741-45b7-b0f1-db7067341070" x="0" y="10" width="515" height="35" blankWhenNull="true" hTextAlign="Center" style="TitleStyle">
			<paragraph lineSpacing="Single" style="TitleStyle"/>
			<expression><![CDATA[$P{ReportTitle}]]></expression>
		</element>
	</title>
	<pageHeader height="20">
		<element kind="staticText" uuid="29ede41f-c9c3-4250-8cc4-99ec1c4651e4" mode="Opaque" x="0" y="5" width="55" height="15" forecolor="#FFFFFF" backcolor="#333333" hTextAlign="Center" style="Sans_Bold">
			<text><![CDATA[ID]]></text>
		</element>
		<element kind="staticText" uuid="00bca530-cad8-48df-be82-30371fc49684" mode="Opaque" x="55" y="5" width="205" height="15" forecolor="#FFFFFF" backcolor="#333333" style="Sans_Bold">
			<text><![CDATA[Name]]></text>
		</element>
		<element kind="staticText" uuid="e5643d5d-98a2-4969-9f00-a512b4906c5e" mode="Opaque" x="260" y="5" width="255" height="15" forecolor="#FFFFFF" backcolor="#333333" style="Sans_Bold">
			<text><![CDATA[Street]]></text>
		</element>
	</pageHeader>
	<detail>
		<band height="20">
			<element kind="textField" uuid="21d5b9b3-0c48-489a-95ce-436044902f49" mode="Opaque" x="0" y="0" width="55" height="19" hTextAlign="Right" vTextAlign="Middle" style="FieldStyle">
				<expression><![CDATA[$F{Id}]]></expression>
				<box rightPadding="5" style="FieldStyle"/>
			</element>
			<element kind="textField" uuid="b40c4545-77bb-4e3d-933f-dd99e6e412c5" positionType="Float" mode="Opaque" x="55" y="0" width="205" height="19" textAdjust="StretchHeight" vTextAlign="Middle" style="RowStyle">
				<expression><![CDATA[$F{FirstName} + " " + $F{LastName}]]></expression>
			</element>
			<element kind="textField" uuid="c16dbc25-0b76-4008-bf63-32753ecac356" positionType="Float" mode="Opaque" x="260" y="0" width="255" height="19" textAdjust="StretchHeight" vTextAlign="Middle" style="RowStyle">
				<expression><![CDATA[$F{Street}]]></expression>
			</element>
			<element kind="line" uuid="d06ffbd0-fa95-4d57-b0c0-dfd69a8417e1" positionType="Float" x="0" y="19" width="515" height="1" forecolor="#808080"/>
		</band>
	</detail>
	<pageFooter height="40">
		<printWhenExpression><![CDATA[!$P{IS_IGNORE_PAGINATION}]]></printWhenExpression>
		<element kind="line" uuid="891eb778-e69d-4781-bb5c-5d99b46d8976" x="0" y="10" width="515" height="1"/>
		<element kind="textField" uuid="16355f62-ef0f-4b03-b14e-898cde2151f9" x="200" y="20" width="80" height="15" hTextAlign="Right">
			<expression><![CDATA["Page " + String.valueOf($V{PAGE_NUMBER}) + " of"]]></expression>
		</element>
		<element kind="textField" uuid="76d6bbab-77b3-4abd-8045-4e9f336c62b8" x="280" y="20" width="75" height="15" evaluationTime="Report" hTextAlign="Left">
			<expression><![CDATA[" " + String.valueOf($V{PAGE_NUMBER})]]></expression>
		</element>
	</pageFooter>
	<summary height="60">
		<element kind="textField" uuid="9cb07480-2b6d-4bfa-8dd3-cc35bb61b475" x="175" y="20" width="165" height="15" textAdjust="StretchHeight" hTextAlign="Center" style="Sans_Italic">
			<expression><![CDATA["There were " + 
					String.valueOf($V{REPORT_COUNT}) + 
					" address records on this report."]]></expression>
		</element>
	</summary>
</jasperReport>
