Jump to content
We've recently updated our Privacy Statement, available here ×

How do I mix fields that stretch and fields that dont


michael.griffiths

Recommended Posts

I have a section of a report that consists of 6 text fields stacked vertically. The first 2 two fields need to be able to stretch to handle varying amounts of data and the next 4 shoudl truncate. The position of the first field is fixed and the other fields should float. When I do this the first fixed size field displays correctly but the fields below it seem to base their position off the last stretch field and not the field immediately above them. The result is that 3rd and 4th fields overlay each other. 

Is it possible to accomplish what I want>? I have tried all the combinations of stretchType, positionType, isStretchWithOverflow I can think of and none seem to work.

Here is a fragment of the report showing my last attempt:

<elementGroup>
<textField isBlankWhenNull="true" isStretchWithOverflow="true">
<reportElement height="0" isRemoveLineWhenBlank="true" uid="960b0af0-bfdd-4ba1-9a73-712b72b00698" width="276" x="261" y="340"/>
<textElement>
<font fontName="Arial" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{FIELD1}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true" isStretchWithOverflow="true">
<reportElement height="0" isRemoveLineWhenBlank="true" positionType="Float" uuid="960b0af0-bfdd-4ba1-9a73-712b72b00698" width="276" x="261" y="341"/>
<textElement>
<font fontName="Arial" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{FIELD2}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement height="10" isRemoveLineWhenBlank="true" positionType="Float" stretchType="NoStretch" uuid="075df05b-1ea8-4433-8e2e-5153f58d4749" width="276" x="261" y="342">
<property name="net.sf.jasperreports.text.truncate.at.char" value="true"/>
<property name="net.sf.jasperreports.text.truncate.suffix" value="..."/>
</reportElement>
<textElement>
<font fontName="Arial" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{FIELD3}]]></textFieldExpression>
</textField>
<textField isBlankWhenNull="true">
<reportElement height="10" isRemoveLineWhenBlank="true" positionType="Float" uuid="47658847-fd10-438b-a16d-acc8c02289fc" width="276" x="261" y="343">
<property name="net.sf.jasperreports.text.truncate.at.char" value="true"/>
<property name="net.sf.jasperreports.text.truncate.suffix" value="..."/>
</reportElement>
<textElement>
<font fontName="Arial" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{FIELD4}]]></textFieldExpression>
</textField>
<textField>
<reportElement height="10" isRemoveLineWhenBlank="true" positionType="Float" uuid="79307e05-d83d-4753-a4b4-725d1db5ee2f" width="276" x="261" y="344"/>
<textElement>
<font fontName="Arial" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{FIELD5}]]></textFieldExpression>
</textField>
<textField>
<reportElement height="10" isRemoveLineWhenBlank="true" positionType="Float" uuid="c2a3b7cf-cf8d-4165-9b8f-8a613c0574b0" width="276" x="261" y="345"/>
<textElement>
<font fontName="Arial" size="7"/>
</textElement>
<textFieldExpression><![CDATA[$F{FIELD6}]]></textFieldExpression>
</textField>

</elementGroup>

Link to comment
Share on other sites

  • Replies 0
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now

×
×
  • Create New...