<jasperReport name="ShipmentsReport" language="java" pageWidth="842" pageHeight="595" orientation="Landscape" columnWidth="812" leftMargin="15" rightMargin="15" topMargin="10" bottomMargin="10" uuid="488fc4c0-8d4e-4bd3-8f28-3497b7349729">
	<property name="net.sf.jasperreports.export.pdf.tagged" value="true"/>
	<property name="net.sf.jasperreports.export.pdf.tag.language" value="EN-US"/>
	<property name="com.jaspersoft.studio.data.defaultdataadapter" value="Sample DB"/>
	<style name="Sans_Normal" default="true" fontName="DejaVu Sans" fontSize="8.0" bold="false" italic="false" underline="false" strikeThrough="false"/>
	<style name="Sans_Large" style="Sans_Normal" fontSize="10.0"/>
	<style name="Sans_Bold" fontName="DejaVu Sans" fontSize="8.0" bold="true" italic="false" underline="false" strikeThrough="false"/>
	<dataset name="Country_Orders" uuid="d526a5a0-b8a0-4bfc-b87a-b418801c0c49">
		<parameter name="Country" class="java.lang.String"/>
		<query language="sql"><![CDATA[SELECT ShippedDate, ShipRegion, ShipCity, Freight
			FROM Orders
			WHERE
				ShipCountry = $P{Country} AND
				ShippedDate IS NOT NULL]]></query>
		<field name="ShippedDate" class="java.sql.Timestamp"/>
		<field name="ShipRegion" class="java.lang.String"/>
		<field name="ShipCity" class="java.lang.String"/>
		<field name="Freight" class="java.lang.Float"/>
	</dataset>
	<query language="sql"><![CDATA[SELECT DISTINCT ShipCountry FROM Orders]]></query>
	<field name="ShipCountry" class="java.lang.String"/>
	<detail>
		<band height="50">
			<element kind="textField" uuid="e244777e-9061-43da-8d1a-8a17b72c96ed" x="0" y="0" width="500" height="15" fontSize="10.0" style="Sans_Bold">
				<expression><![CDATA["Shipments to " + $F{ShipCountry}]]></expression>
			</element>
			<element kind="crosstab" uuid="12fcc3d0-f46e-4987-be7d-05226d019b24" x="0" y="20" width="812" height="20" columnBreakOffset="10" repeatColumnHeaders="false">
				<dataset>
					<datasetRun uuid="ecb060f4-4299-435f-9623-f879eeed8e62" subDataset="Country_Orders">
						<parameter name="Country">
							<expression><![CDATA[$F{ShipCountry}]]></expression>
						</parameter>
					</datasetRun>
				</dataset>
				<headerCell>
					<element kind="staticText" uuid="e4bccd69-3639-49f9-a52f-cb9d215556a0" x="4" y="4" width="112" height="42" hTextAlign="Center" vTextAlign="Middle" style="Sans_Large">
						<text><![CDATA[Shipments total freight]]></text>
					</element>
					<box>
						<pen lineWidth="1.0"/>
					</box>
				</headerCell>
				<rowGroup name="Region" totalPosition="End" width="50">
					<bucket class="java.lang.String">
						<expression><![CDATA[$F{ShipRegion}]]></expression>
					</bucket>
					<header>
						<element kind="textField" uuid="2b574bb6-b7c0-4cbd-918b-d56b101147a0" x="5" y="5" width="40" height="26">
							<expression><![CDATA[$V{Region} == null ? "No region" : $V{Region}]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</header>
					<totalHeader mode="Opaque" backcolor="#60FFFF">
						<element kind="textField" uuid="a521bf3b-215a-4f6e-9f12-c8cfce6f4281" x="5" y="0" width="110" height="22" vTextAlign="Middle">
							<expression><![CDATA[$P{Country} + " Total"]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</totalHeader>
				</rowGroup>
				<rowGroup name="City" totalPosition="End" width="70">
					<bucket class="java.lang.String">
						<expression><![CDATA[$F{ShipCity}]]></expression>
					</bucket>
					<header>
						<element kind="textField" uuid="f9d671c3-2ea1-46bc-b187-a76fc2f95d8f" x="5" y="0" width="60" height="16" vTextAlign="Middle">
							<expression><![CDATA[$V{City}]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</header>
					<totalHeader mode="Opaque" backcolor="#E0FFFF">
						<element kind="staticText" uuid="f6e837cb-ffde-492b-a2d6-7cc1da59decc" x="5" y="0" width="60" height="20" vTextAlign="Middle">
							<text><![CDATA[Total]]></text>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</totalHeader>
				</rowGroup>
				<columnGroup name="ShipYear" totalPosition="End" height="25" position="Stretch">
					<bucket class="java.util.Date">
						<expression><![CDATA[net.sf.jasperreports.samples.crosstabs.CrosstabApp.truncateToYear($F{ShippedDate})]]></expression>
					</bucket>
					<header>
						<element kind="rectangle" uuid="31d153a1-cb57-463d-85a2-559c651c5da2" x="4" y="4" width="82" height="17" radius="10">
							<pen lineWidth="1.0"/>
						</element>
						<element kind="textField" uuid="8be9f789-5480-4b50-aaa0-1fae5c3b9847" x="5" y="5" width="80" height="15" pattern="yyyy" hTextAlign="Center" vTextAlign="Middle">
							<expression><![CDATA[$V{ShipYear}]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</header>
					<totalHeader mode="Opaque" backcolor="#FFFF60">
						<element kind="staticText" uuid="837e75c7-0cc4-433d-84b2-2e75e91675dd" x="5" y="5" width="35" height="15">
							<text><![CDATA[Total]]></text>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</totalHeader>
				</columnGroup>
				<columnGroup name="ShipMonth" totalPosition="End" height="25">
					<bucket class="java.util.Date">
						<expression><![CDATA[net.sf.jasperreports.samples.crosstabs.CrosstabApp.truncateToMonth($F{ShippedDate})]]></expression>
					</bucket>
					<header>
						<element kind="textField" uuid="84361608-be80-40df-be22-6877b39fb61a" x="5" y="2" width="35" height="21" pattern="MMM" hTextAlign="Center">
							<expression><![CDATA[$V{ShipMonth}]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</header>
					<totalHeader mode="Opaque" backcolor="#FFFFC0">
						<element kind="textField" uuid="e0938dfe-5528-4f8b-93fe-33390d618be5" x="5" y="2" width="35" height="21" hTextAlign="Center">
							<expression><![CDATA[msg("{0,date,yyyy} Total", $V{ShipYear})]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</totalHeader>
				</columnGroup>
				<measure name="FreightSum" calculation="Sum" class="java.lang.Float">
					<expression><![CDATA[$F{Freight}]]></expression>
				</measure>
				<cell width="45" height="16">
					<contents mode="Opaque" backcolor="#FFFFFF">
						<element kind="textField" uuid="e256b054-5bed-4834-a6ec-260b20ee28ae" x="0" y="0" width="40" height="16" pattern="#0.0" hTextAlign="Right" vTextAlign="Middle">
							<expression><![CDATA[$V{FreightSum}]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</contents>
				</cell>
				<cell width="45" columnTotalGroup="ShipMonth">
					<contents mode="Opaque" backcolor="#FFFFC0">
						<element kind="textField" uuid="ab41e42a-30d5-48a8-b382-c8fcdf62db40" x="0" y="0" width="40" height="16" pattern="#0.0" hTextAlign="Right" vTextAlign="Middle" style="Sans_Bold">
							<expression><![CDATA[$V{FreightSum}]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</contents>
				</cell>
				<cell width="45" columnTotalGroup="ShipYear">
					<contents mode="Opaque" backcolor="#FFFF60">
						<element kind="textField" uuid="79002120-927d-4454-8fa4-2c29494d0dcf" x="0" y="0" width="40" height="16" pattern="#0.0" hTextAlign="Right" vTextAlign="Middle" style="Sans_Bold">
							<expression><![CDATA[$V{FreightSum}]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</contents>
				</cell>
				<cell height="20" rowTotalGroup="City">
					<contents mode="Opaque" backcolor="#E0FFFF">
						<element kind="textField" uuid="57f1e3a4-c7d7-4122-91e4-46ee46b1f9d6" x="0" y="0" width="40" height="20" pattern="#0.0" hTextAlign="Right" vTextAlign="Middle">
							<expression><![CDATA[$V{FreightSum}]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</contents>
				</cell>
				<cell rowTotalGroup="City" columnTotalGroup="ShipMonth">
					<contents mode="Opaque" backcolor="#E0FFC0">
						<element kind="textField" uuid="551368ea-e128-413f-9791-5533d0d75cab" x="0" y="0" width="40" height="20" pattern="#0.0" hTextAlign="Right" vTextAlign="Middle" style="Sans_Bold">
							<expression><![CDATA[$V{FreightSum}]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</contents>
				</cell>
				<cell rowTotalGroup="City" columnTotalGroup="ShipYear">
					<contents mode="Opaque" backcolor="#E0FF60">
						<element kind="textField" uuid="c0c84867-2554-4593-8617-61cf78cab83a" x="0" y="0" width="40" height="20" pattern="#0.0" hTextAlign="Right" vTextAlign="Middle" style="Sans_Bold">
							<expression><![CDATA[$V{FreightSum}]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</contents>
				</cell>
				<cell height="24" rowTotalGroup="Region">
					<contents mode="Opaque" backcolor="#60FFFF">
						<element kind="textField" uuid="8c707b60-3bf6-47da-88e9-037a21612539" x="0" y="0" width="40" height="12" pattern="#0.0" hTextAlign="Right" vTextAlign="Bottom" style="Sans_Bold">
							<expression><![CDATA[$V{FreightSum}]]></expression>
						</element>
						<element kind="textField" uuid="d80bb123-0551-4c3a-aa01-b2408f07beb7" x="0" y="12" width="40" height="12" hTextAlign="Right" style="Sans_Bold">
							<expression><![CDATA[msg("({0,number,percent})", $V{FreightSum} / $V{FreightSum_ShipYear_ALL})]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</contents>
				</cell>
				<cell rowTotalGroup="Region" columnTotalGroup="ShipMonth">
					<contents mode="Opaque" backcolor="#60FFC0">
						<element kind="textField" uuid="1eca9e09-651a-43bb-b1e7-efbd71a1db2e" x="0" y="0" width="40" height="12" pattern="#0.0" hTextAlign="Right" vTextAlign="Bottom" style="Sans_Bold">
							<expression><![CDATA[$V{FreightSum}]]></expression>
						</element>
						<element kind="textField" uuid="9de656c8-003b-4030-aa0d-3007a3a67a72" x="0" y="12" width="40" height="12" hTextAlign="Right" style="Sans_Bold">
							<expression><![CDATA[msg("({0,number,percent})", $V{FreightSum} / $V{FreightSum_ShipYear_ALL})]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</contents>
				</cell>
				<cell rowTotalGroup="Region" columnTotalGroup="ShipYear">
					<contents mode="Opaque" backcolor="#60FF60">
						<element kind="textField" uuid="cba887c5-3b70-400f-a3d1-d225d17171b8" x="0" y="0" width="40" height="12" pattern="#0.0" hTextAlign="Right" vTextAlign="Bottom" style="Sans_Bold">
							<expression><![CDATA[$V{FreightSum}]]></expression>
						</element>
						<element kind="textField" uuid="3e99be05-6903-49bf-ae14-4a164730b4b1" x="0" y="12" width="40" height="12" hTextAlign="Right" style="Sans_Bold">
							<expression><![CDATA[msg("({0,number,percent})", $V{FreightSum} / $V{FreightSum_ShipYear_ALL})]]></expression>
						</element>
						<box>
							<pen lineWidth="1.0"/>
						</box>
					</contents>
				</cell>
				<parameter name="Country" class="java.lang.String">
					<expression><![CDATA[$F{ShipCountry}]]></expression>
				</parameter>
			</element>
		</band>
	</detail>
</jasperReport>
