Java Reference
In-Depth Information
Again, the code to fill and export the report is similar to what we have seen before.
Therefore, we chose not to display it. The generated report should look like this:
The FixRelativeToTop value of the positionType attribute of <reportElement>
forces the element to stay in the same position regardless of whether any other
element stretches. Hence, we ended up with the two elements overlapping each
other, which is probably not what we want.
It would be nice if the <staticText> element would be pushed down, if the
<textField> element stretches. We can accomplish this by setting positionType
to Float .
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN"
<jasperReport name="FloatDemo" >
<field name="lots_of_data" class="java.lang.String"/>
<band height="55">
<textField isStretchWithOverflow="true">
<reportElement x="0" y="0" width="100" height="24"/>
<box border="Thin"/>
<textFieldExpression class="java.lang.String">
<reportElement width="500" y="25" x="0" height="30"
<box border="Thin"/>
<![CDATA[This staticText element has a positionType of
Search WWH ::

Custom Search