2013-03-30 178 views
0

我正在使用JasperReports作爲Web應用程序的報告工具。 (JSP + Servlets)在jasper報告中添加垂直線

我開發了一個名爲Cust的報告,其報告名爲CustSub。在子報告中,我想要一些列的垂直線,所以我添加了的確切高度的lineBond,Frame和垂直line的高度是相同的。

enter image description here

因此,讓我知道是否有這樣做的沒有更好的辦法?

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> 
+0

請分享您的代碼。 –

+0

@Bhushan你設置了* textFields *(* staticTexts *)的邊框嗎?您應該發佈您的模板 –

+0

@Gopinagh請參閱最新代碼 – Bhushan

回答

1

只需拖動行元素,並拖動該元素的底部中間點以增加大小,然後通過拖動左中點來減小寬度。

+0

我完全一樣,但它沒有給出預期的輸出 – Bhushan