<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD Report Design//EN" 
	"http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport name="OrderHistory" pageWidth="565" pageHeight="842" columnWidth="545" 
	leftMargin="10" rightMargin="10" topMargin="30" bottomMargin="30">

	<reportFont name="Arial_Normal" isDefault="true" fontName="Arial" size="12" 
		isBold="false" isItalic="false" isUnderline="false" isStrikeThrough="false" 
		pdfFontName="Helvetica" pdfEncoding="Cp1252" isPdfEmbedded="false" />
	<reportFont name="Arial_Bold" isDefault="false" fontName="Arial" size="12" 
		isBold="true" isItalic="false" isUnderline="false" isStrikeThrough="false" 
		pdfFontName="Helvetica-Bold" pdfEncoding="Cp1252" isPdfEmbedded="false" />
	<reportFont name="Arial_Italic" isDefault="false" fontName="Arial" size="12" 
		isBold="false" isItalic="true" isUnderline="false" isStrikeThrough="false" 
		pdfFontName="Helvetica-Oblique" pdfEncoding="Cp1252" isPdfEmbedded="false" />

	<parameter name="customer_id" class="java.lang.Integer"></parameter>
	<queryString>
		<![CDATA[SELECT order_id, order_date, status, placed_by FROM 
			sample.CUSTOMER_ORDER WHERE customer_id=$P{customer_id}]]>
	</queryString>
	<field name="order_id" class="java.lang.Integer"></field>
	<field name="order_date" class="java.util.Date"></field>
	<field name="status" class="java.lang.String"></field>
	<field name="placed_by" class="java.lang.String"></field>

	<title>
		<band height="50">
			<line>
				<reportElement x="0" y="10" width="520" height="1" />
				<graphicElement />
			</line>
			<staticText>
				<reportElement x="0" y="12" width="345" height="30" />
				<textElement>
					<font reportFont="Arial_Normal" size="22" />
				</textElement>
				<text>
					<![CDATA[Order History]]>
				</text>
			</staticText>
		</band>
	</title>

	<pageHeader>
		<band></band>
	</pageHeader>
	<columnHeader>
		<band height="20">
			<staticText>
				<reportElement mode="Opaque" x="0" y="2" width="130" 
					height="15" backcolor="#bbbbbb" />
				<textElement>
					<font reportFont="Arial_Bold" />
				</textElement>
				<text>
					<![CDATA[Order No.]]>
				</text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="130" y="2" width="130" 
					height="15" backcolor="#bbbbbb" />
				<textElement>
					<font reportFont="Arial_Bold" />
				</textElement>
				<text>
					<![CDATA[Order Date]]>
				</text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="260" y="2" width="130" 
					height="15" backcolor="#bbbbbb" />
				<textElement>
					<font reportFont="Arial_Bold" />
				</textElement>
				<text>
					<![CDATA[Status]]>
				</text>
			</staticText>
			<staticText>
				<reportElement mode="Opaque" x="390" y="2" width="130" 
					height="15" backcolor="#bbbbbb" />
				<textElement>
					<font reportFont="Arial_Bold" />
				</textElement>
				<text>
					<![CDATA[Placed]]>
				</text>
			</staticText>
		</band>
	</columnHeader>
	<detail>
		<band height="20">
			<textField>
				<reportElement x="0" y="2" width="130" height="15" />
				<textElement textAlignment="Left" />
				<textFieldExpression class="java.lang.String">
					<![CDATA[String.valueOf($F{order_id})]]>
				</textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true">
				<reportElement positionType="Float" x="130" y="2" 
					width="130" height="15" />
				<textElement />
				<textFieldExpression class="java.lang.String">
					<![CDATA[String.valueOf($F{order_date})]]>
				</textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true">
				<reportElement positionType="Float" x="260" y="2" 
					width="130" height="15" />
				<textElement />
				<textFieldExpression class="java.lang.String">
					<![CDATA[$F{status}]]>
				</textFieldExpression>
			</textField>
			<textField isStretchWithOverflow="true">
				<reportElement positionType="Float" x="390" y="2" 
					width="130" height="15" />
				<textElement />
				<textFieldExpression class="java.lang.String">
					<![CDATA[$F{placed_by}]]>
				</textFieldExpression>
			</textField>
			<line>
				<reportElement positionType="Float" x="0" y="19" 
					width="520" height="1" forecolor="#808080" />
				<graphicElement />
			</line>
		</band>
	</detail>
	<columnFooter>
		<band></band>
	</columnFooter>
	<pageFooter>
		<band></band>
	</pageFooter>
	<summary>
		<band height="35">
			<textField isStretchWithOverflow="true">
				<reportElement x="175" y="10" width="165" height="15" />
				<textElement textAlignment="Center">
					<font reportFont="Arial_Italic" />
				</textElement>
				<textFieldExpression class="java.lang.String">
					<![CDATA["This customer has placed " + 
					String.valueOf($V{REPORT_COUNT}) + 
					"  orders."]]>
				</textFieldExpression>
			</textField>
		</band>
	</summary>
</jasperReport>