我有你在我的數據庫下面看的類別和客戶表:如何更改組更改時的細節帶顏色?
然後我想打從這些表報告和碧玉由category id
分組。這是我的jrxml
文件:
<?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="jasper" pageWidth="595" pageHeight="842" columnWidth="555" leftMargin="20" rightMargin="20" topMargin="20" bottomMargin="20">
<queryString language="plsql">
<![CDATA[select c.cid as "CID", c.title, j.id, j.name, j.family
from Jasper j
join Category c
on j.c_id = c.cid]]>
</queryString>
<field name="CID" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="TITLE" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="ID" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="NAME" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<field name="FAMILY" class="java.lang.String">
<fieldDescription><![CDATA[]]></fieldDescription>
</field>
<group name="category">
<groupExpression><![CDATA[$F{CID}]]></groupExpression>
<groupFooter>
<band>
<frame>
<reportElement x="1" y="0" width="212" height="0"/>
<box>
<topPen lineWidth="0.5"/>
</box>
</frame>
</band>
</groupFooter>
</group>
<background>
<band splitType="Stretch"/>
</background>
<pageHeader>
<band height="33" splitType="Stretch">
<staticText>
<reportElement x="196" y="1" width="162" height="32"/>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Consolas" size="20" isBold="true" isItalic="true"/>
</textElement>
<text><![CDATA[Jasper]]></text>
</staticText>
</band>
</pageHeader>
<columnHeader>
<band height="20" splitType="Stretch">
<staticText>
<reportElement mode="Opaque" x="213" y="0" width="100" height="20" backcolor="#F0F0F0"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Consolas"/>
</textElement>
<text><![CDATA[ID]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="313" y="0" width="100" height="20" backcolor="#F0F0F0"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Consolas"/>
</textElement>
<text><![CDATA[Name]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="413" y="0" width="100" height="20" backcolor="#F0F0F0"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Consolas"/>
</textElement>
<text><![CDATA[Family]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="1" y="0" width="100" height="20" backcolor="#F0F0F0"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Consolas"/>
</textElement>
<text><![CDATA[CID]]></text>
</staticText>
<staticText>
<reportElement mode="Opaque" x="101" y="0" width="112" height="20" backcolor="#F0F0F0"/>
<box>
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement textAlignment="Center" verticalAlignment="Middle">
<font fontName="Consolas"/>
</textElement>
<text><![CDATA[Title]]></text>
</staticText>
</band>
</columnHeader>
<detail>
<band height="20" splitType="Stretch">
<textField>
<reportElement x="213" y="0" width="100" height="20"/>
<box leftPadding="5">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement>
<font fontName="Consolas"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{ID}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="313" y="0" width="100" height="20"/>
<box leftPadding="5">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement>
<font fontName="Consolas"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{NAME}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="413" y="0" width="100" height="20"/>
<box leftPadding="5">
<topPen lineWidth="0.5"/>
<leftPen lineWidth="0.5"/>
<bottomPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
<textElement>
<font fontName="Consolas"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{FAMILY}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="1" y="0" width="100" height="20">
<printWhenExpression><![CDATA[new Boolean($V{category_COUNT}.longValue() == 1 ? true : false)]]></printWhenExpression>
</reportElement>
<box leftPadding="5">
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.0"/>
<bottomPen lineWidth="0.0"/>
<rightPen lineWidth="0.0"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="Consolas"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{CID}]]></textFieldExpression>
</textField>
<textField>
<reportElement x="101" y="0" width="112" height="20">
<printWhenExpression><![CDATA[new Boolean($V{category_COUNT}.longValue() == 1 ? true : false)]]></printWhenExpression>
</reportElement>
<box leftPadding="5">
<topPen lineWidth="0.0"/>
<leftPen lineWidth="0.0"/>
<bottomPen lineWidth="0.0"/>
<rightPen lineWidth="0.0"/>
</box>
<textElement verticalAlignment="Middle">
<font fontName="Consolas"/>
</textElement>
<textFieldExpression class="java.lang.String"><![CDATA[$F{TITLE}]]></textFieldExpression>
</textField>
<frame>
<reportElement x="1" y="0" width="100" height="20"/>
<box>
<leftPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
</frame>
<frame>
<reportElement x="101" y="0" width="112" height="20"/>
<box>
<leftPen lineWidth="0.5"/>
<rightPen lineWidth="0.5"/>
</box>
</frame>
</band>
</detail>
</jasperReport>
結果這個文件是這樣的:
但我想TI具有導致這樣的:
如何我可以那樣做嗎?
出事了與圖像「與樣式工作」 ... – jjlema
那你是什麼意思? –
對不起,它是我的錯,我無法看到圖像。 – jjlema