我正在使用JasperReports作爲Web應用程序的報告工具。 (JSP + Servlets)在jasper報告中添加垂直線
我開發了一個名爲Cust
的報告,其報告名爲CustSub
。在子報告中,我想要一些列的垂直線,所以我添加了的確切高度的line
。 Bond
,Frame
和垂直line
的高度是相同的。
因此,讓我知道是否有這樣做的沒有更好的辦法?
UPDATE1
這是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
(我已經包括了從代碼只有兩個文本框,所以請不要考慮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>
請分享您的代碼。 –
@Bhushan你設置了* textFields *(* staticTexts *)的邊框嗎?您應該發佈您的模板 –
@Gopinagh請參閱最新代碼 – Bhushan