JasperReportsを Web アプリケーションのレポート ツールとして使用しています。(JSP + サーブレット)
Cust
という名前のサブレポートを持つという名前のレポートを作成しましCustSub
た。サブレポートでは、いくつかの列に垂直線が必要なので、そのline
正確な高さを追加しましたframe
。とBond
の高さは同じです。Frame
line
それで、これを行うより良い方法があれば教えてください。
アップデート1
これはstyles
私が申請した交互の列の色です
<style name="Detail" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman"/>
<style name="Row" mode="Transparent" fontName="Times New Roman" pdfFontName="Times-Roman">
<conditionalStyle>
<conditionExpression><![CDATA[$V{REPORT_COUNT}%2 == 0]]></conditionExpression>
<style mode="Opaque" backcolor="#F0EFEF"/>
</conditionalStyle>
</style>
そしてこれはDetail Band
(コードから2つのテキストフィールドしか含めていないのでx="258"
、行を考慮しないでください)
<detail>
<band height="18" splitType="Stretch">
<frame>
<reportElement uuid="aa7987da-d84a-4d11-b079-44005699151d" style="Row" stretchType="RelativeToBandHeight" mode="Opaque" x="1" y="0" width="555" height="18"/>
<textField isStretchWithOverflow="true" pattern="dd/MM/yy" isBlankWhenNull="true">
<reportElement uuid="8a0ce8e2-1beb-4300-81ea-f3422abef623" style="Detail" positionType="Float" x="2" y="0" width="60" height="18"/>
<textElement>
<font fontName="Times New Roman" size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{TRNDATE}]]></textFieldExpression>
</textField>
<textField isStretchWithOverflow="true" isBlankWhenNull="true">
<reportElement uuid="74be5885-f344-4451-a3a5-62213d3a3dd1" style="Detail" positionType="Float" x="120" y="0" width="68" height="18"/>
<textElement>
<font fontName="Times New Roman" size="14"/>
</textElement>
<textFieldExpression><![CDATA[$F{AMOUNT}]]></textFieldExpression>
</textField>
<line>
<reportElement uuid="06d698e3-34c2-445a-8787-a54bd38a2121" style="Detail" stretchType="RelativeToBandHeight" mode="Transparent" x="258" y="0" width="1" height="18" backcolor="#FFFFFF"/>
</line>
</frame>
</band>
</detail>