I need a staticText to staticText under another variable-height element. I take a sample from the book JasperReports for Java Programmers . It says it is possible. The difference with my example is that I use a string encoded string in textFieldExpression , they use the $ F {} field.
<textField isStretchWithOverflow="true" hyperlinkType="None"> <reportElement x="0" y="0" width="100" height="24"/> <box> <pen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement/> <textFieldExpression class="java.lang.String"><![CDATA["jjjjjjjjjjj oooooooooo uuuuuuuuuu aaaaaaaaaa xxxxxxxxx u ttttt"]]></textFieldExpression> </textField> <staticText> <reportElement positionType="Float" x="0" y="25" width="500" height="30"/> <box> <pen lineWidth="0.5" lineStyle="Solid"/> </box> <textElement/> <text><![CDATA[ This staticText element has a positionType of "Float" ppp ]]></text> </staticText>
It says that when using positionType="Float" the y attribute is ignored because the staticText is located below the textField . It seems to work, BUT ... maybe they're BS'ing me? textField has y = 0 and height = 24. staticText has y = 25. Match? If I change staticText y, it is obvious that it is not ignored: the element is positioned wherever I tell it. There is no swimming !!! Quote from the book:
As we can see, setting the positionType attribute of <reportElement> to Float made JasperReports ignore the y position of the <staticText> element, which was pushed down by the stretched <textField> element.
No, we donโt see how they ignore him, because y = 25 is the place where we expected it! Does positionType="Float" for staticText in general? Thanks!
jasper-reports
German
source share