开发者

Line is not visible in subreport jasper report?

开发者 https://www.devze.com 2022-12-28 19:57 出处:网络
I am using jasper report to create pdf document. I used one Subreport inside the main document. This Subreport consist of 3 textfield and one line. I use javabean datasource to populate the value. Now

I am using jasper report to create pdf document. I used one Subreport inside the main document. This Subreport consist of 3 textfield and one line. I use javabean datasource to populate the value. Now I could not see line if the datasource returns null value. Can anyone guide me how to solve this problem.

Below you can see the xml code which I used for drawing line in jrxml file:

<line direction="TopDown">
    <reportElement mode="Transparent" x="-6" y="17" width="480" height="0" 
        forecolor="#C6C8CA" key="line-1" isPrintInFirstWholeBand="true"/>
    <graphicElement stretchType="NoStretch">
        <pen lineWidth="0.25" lineStyle="Solid"/>
    </graphicElement>
&l开发者_如何学运维t;/line>


Is the line in the same Band with the text fields? If yes, then that's you problem. In Jasper if the datasource returns no elements. The band will not be rendered, as simple as that.

If you want the line to always appear put it in a band that is always rendered by default. Like Page_Header, Page_Footer ...etc.


This also happens when 2 items overlap. If your text box is over the line, change line's order by Order->Bring to Front

0

精彩评论

暂无评论...
验证码 换一张
取 消