isRemoveLineWhenBlank

By: Mihai Gheorghiu - tanethq
isRemoveLineWhenBlank
2002-03-25 13:38
It is my understanding that isRemoveLineWhenBlank avoids printing a line when there's actually nothing on it, e.g. I have 2 address lines, address1 and address2, followed by city, state and zip on one line. If address2 is blank, city, state, zip will be printed immediately under address1, without leaving the vertical space for address2.
It is a very useful feature, saving quite a few printWhenExpressions. Any forecasts as to its availability :-)


By: Teodor Danciu - teodord
RE: isRemoveLineWhenBlank
2002-09-05 04:58

Hi,

The "isRemoveLineWhenBlank" attribute and the
others are now implemented in the 0.4.0 version.

Thank you,
Teodor



By: John Conner - conner_john
RE: isRemoveLineWhenBlank
2002-09-08 21:45
I'm trying to use the new isRemoveLineWhenBlank attribute without success. Here is the code snippet for the report definition:

<detail>
<band height="130">
<textField isBlankWhenNull="true">
<reportElement x="0" y="35" width="350" height="15"
isRemoveLineWhenBlank="true" positionType="Float"/>
<textElement textAlignment="Left"/>
<textFieldExpression class="java.lang.String">
$F{line1}
</textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="0" y="50" width="350" height="15"
isRemoveLineWhenBlank="true" positionType="Float"/>
<textElement textAlignment="Left"/>
<textFieldExpression class="java.lang.String">
$F{line2}
</textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement x="0" y="65" width="350" height="15"
isRemoveLineWhenBlank="true" positionType="Float"/>
<textElement textAlignment="Left"/>
<textFieldExpression class="java.lang.String">
$F{city}+", "+$F{state}+" "+$F{zip}
</textFieldExpression>
</textField>
</band>
</detail>

The $F{line2} is blank in the data I pull from the datasource, however, it is still being displayed as a blank line on the report output as follows:

John Smith

Noble, IL 99999

Thoughts on what I'm doing wrong?

John


By: Teodor Danciu - teodord
RE2: isRemoveLineWhenBlank
2002-09-08 23:03

Hi,

Make sure the text field that you want to disappear
does not share vertical space with any other
element.
The most probable cause is that you have maybe
a rectangle around the text fields or some vertical
lines on the sideways.

The vertical space collapses only
when "isRemoveLineWhenBlank" elements are
the only elements present in the given vertical
space.

I hope this helps.
Teodor
2001 JI Open Discussion's picture
Joined: Aug 10 2006 - 3:26am
Last seen: 16 years 10 months ago

0 Answers:

No answers yet
Feedback
randomness