⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 expensereport2.jrxml

📁 Jasper Report 报表。用iReport的Nebeans插件制作。包括调用方法。
💻 JRXML
字号:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "-//JasperReports//DTD JasperReport//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd">

<jasperReport name="null" pageWidth="595" pageHeight="842" columnWidth="535" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
	<parameter name="MIN_ID" class="java.lang.Integer" isForPrompting="false"/>
	<parameter name="MAX_ID" class="java.lang.Integer" isForPrompting="false"/>
	<parameter name="BEGIN_DATE" class="java.util.Date" isForPrompting="false"/>
	<queryString language="SQL">
		<![CDATA[SELECT
     PETS."NAME" AS NAME,
     EXPENSES."EXPENSETYPE" AS TYPE,
     EXPENSES."COST" AS COST,
     EXPENSES."OCCURDATE" AS DATE,
     EXPENSES."NOTES" AS NOTES
FROM
     "APP"."PETS" PETS INNER JOIN "APP"."EXPENSES" EXPENSES ON PETS."ID" = EXPENSES."PETID"
WHERE
          petid >= $P{MIN_ID}
 AND petid <= $P{MAX_ID}
 AND occurdate >= $P{BEGIN_DATE}
ORDER BY
     EXPENSES."OCCURDATE" ASC]]>
	</queryString>
	<field name="NAME" class="java.lang.String">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="TYPE" class="java.lang.String">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="COST" class="java.lang.Double">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="DATE" class="java.sql.Date">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<field name="NOTES" class="java.lang.String">
		<fieldDescription><![CDATA[]]></fieldDescription>
	</field>
	<variable name="SUBTOTAL_COST" class="java.lang.Double" resetType="Group" resetGroup="NAME" calculation="Sum">
		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
	</variable>
	<variable name="TOTAL_COST" class="java.lang.Double" calculation="Sum">
		<variableExpression><![CDATA[$F{COST}]]></variableExpression>
	</variable>
	<group name="NAME">
		<groupExpression><![CDATA[$F{NAME}]]></groupExpression>
		<groupHeader>
			<band height="27">
				<staticText>
					<reportElement mode="Opaque" x="0" y="0" width="65" height="27" forecolor="#FFFFFF" backcolor="#000000"/>
					<textElement textAlignment="Right">
						<font size="18"/>
					</textElement>
					<text><![CDATA[NAME: ]]></text>
				</staticText>
				<textField hyperlinkType="None">
					<reportElement mode="Opaque" x="65" y="0" width="490" height="27" forecolor="#FFFFFF" backcolor="#000000"/>
					<textElement>
						<font size="18" isBold="true"/>
					</textElement>
					<textFieldExpression class="java.lang.String"><![CDATA[$F{NAME}]]></textFieldExpression>
				</textField>
			</band>
		</groupHeader>
		<groupFooter>
			<band height="36">
				<line direction="BottomUp">
					<reportElement key="line" x="1" y="4" width="554" height="1"/>
				</line>
				<textField pattern="#,##0.00;-#,##0.00" hyperlinkType="None">
					<reportElement x="140" y="16" width="136" height="20"/>
					<textElement>
						<font size="12" isBold="true" isItalic="true" isUnderline="true"/>
					</textElement>
					<textFieldExpression class="java.lang.Double"><![CDATA[$V{SUBTOTAL_COST}]]></textFieldExpression>
				</textField>
				<staticText>
					<reportElement x="1" y="16" width="129" height="20"/>
					<textElement textAlignment="Right">
						<font size="12" isBold="true" isItalic="true" isUnderline="true"/>
					</textElement>
					<text><![CDATA[TOTAL COST]]></text>
				</staticText>
			</band>
		</groupFooter>
	</group>
	<background>
		<band/>
	</background>
	<title>
		<band height="58">
			<line>
				<reportElement x="0" y="8" width="555" height="1"/>
			</line>
			<line>
				<reportElement positionType="FixRelativeToBottom" x="0" y="51" width="555" height="1"/>
			</line>
			<staticText>
				<reportElement x="65" y="13" width="424" height="35"/>
				<textElement textAlignment="Center">
					<font size="22" isBold="true"/>
				</textElement>
				<text><![CDATA[Pet's Expenses Report]]></text>
			</staticText>
		</band>
	</title>
	<pageHeader>
		<band/>
	</pageHeader>
	<columnHeader>
		<band/>
	</columnHeader>
	<detail>
		<band height="98">
			<staticText>
				<reportElement x="1" y="16" width="48" height="20"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="12"/>
				</textElement>
				<text><![CDATA[TYPE: ]]></text>
			</staticText>
			<textField hyperlinkType="None">
				<reportElement x="49" y="16" width="507" height="20"/>
				<textElement>
					<font size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{TYPE}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="1" y="36" width="48" height="20"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="12"/>
				</textElement>
				<text><![CDATA[COST: ]]></text>
			</staticText>
			<textField hyperlinkType="None">
				<reportElement x="49" y="36" width="507" height="20"/>
				<textElement>
					<font size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.Double"><![CDATA[$F{COST}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="1" y="56" width="48" height="20"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="12"/>
				</textElement>
				<text><![CDATA[DATE: ]]></text>
			</staticText>
			<textField pattern="dd-MMM-yyyy" hyperlinkType="None">
				<reportElement x="49" y="56" width="507" height="20"/>
				<textElement>
					<font size="12"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[$F{DATE}]]></textFieldExpression>
			</textField>
			<staticText>
				<reportElement x="1" y="76" width="48" height="20"/>
				<textElement textAlignment="Right" verticalAlignment="Middle">
					<font size="12"/>
				</textElement>
				<text><![CDATA[NOTES: ]]></text>
			</staticText>
			<textField isStretchWithOverflow="true" hyperlinkType="None">
				<reportElement x="49" y="76" width="507" height="20"/>
				<textElement>
					<font size="12"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA[$F{NOTES}]]></textFieldExpression>
			</textField>
		</band>
	</detail>
	<columnFooter>
		<band/>
	</columnFooter>
	<pageFooter>
		<band height="26">
			<textField evaluationTime="Report" pattern="" isBlankWhenNull="false" hyperlinkType="None">
				<reportElement key="textField" x="516" y="6" width="36" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement>
					<font size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["" + $V{PAGE_NUMBER}]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false" hyperlinkType="None">
				<reportElement key="textField" x="445" y="6" width="67" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement textAlignment="Right">
					<font size="10"/>
				</textElement>
				<textFieldExpression class="java.lang.String"><![CDATA["Page " + $V{PAGE_NUMBER} + " of "]]></textFieldExpression>
			</textField>
			<textField pattern="" isBlankWhenNull="false" hyperlinkType="None">
				<reportElement key="textField" x="11" y="7" width="129" height="19" forecolor="#000000" backcolor="#FFFFFF"/>
				<box>
					<topPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<leftPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<bottomPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
					<rightPen lineWidth="0.0" lineStyle="Solid" lineColor="#000000"/>
				</box>
				<textElement>
					<font size="10"/>
				</textElement>
				<textFieldExpression class="java.util.Date"><![CDATA[new Date()]]></textFieldExpression>
			</textField>
		</band>
	</pageFooter>
	<summary>
		<band isSplitAllowed="false"/>
	</summary>
</jasperReport>

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -