Jump to content

Problem with multiple textfields


redshadow

Recommended Posts

Hello!

I already looked for about 2 hours to find a solution for my problem but i don't even know what to look for to find a answer. So I hope anyone here can help me with this.

 

My problem is that I have 3 textfields

  • In the first I have some static text
  • In the second I have dynamic text which can overflow, this dynamic text shall be italic
  • In the third I have static text which is normal text

My problem now is that these three text field belong together, but I can not make it that subtext is italic. So I have to use 3 textfields. How can I tell jasper to float the third textfield relative to the second one?

Maybe my explanation is a bit hard to understand but I really don't know how to formulate it.

 

Here a try to show you what I mean:

[Textfield 1][Textfield 2 ....

...which can overflow, the overflowed text shall start at the left side][Textfield 3, relative X-Coordinate to Textfield 2]

 

I hope you can help me! Thanks!

Link to comment
Share on other sites

  • Replies 2
  • Created
  • Last Reply

Top Posters In This Topic

Popular Days

Top Posters In This Topic

I just found the isStyledText attribute so this problem is solved!

But now I have another problem. I have something like a table and have problems with the borders.

I make the border for my "table" with <line>, but the line does not stretch to the bottom of the detail. I already checked the stretch to tallest object checkbox but it doesn't help. Here you can see a picture and the code.

Code:
<?xml version="1.0" encoding="UTF-8"?><jasperReport xmlns="http://jasperreports.sourceforge.net/jasperreports" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:schemaLocation="http://jasperreports.sourceforge.net/jasperreports http://jasperreports.sourceforge.net/xsd/jasperreport.xsd" name="PflichtgegenstandNotenSubreport" language="groovy" columnCount="2" pageWidth="594" pageHeight="200" columnWidth="297" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">	<queryString language="hql">		<![CDATA[from ViSchulnachrichtNoten where lfvSsdId = 2261 and gegGarKurzbez IN('R','P','W')]]>	</queryString>	<field name="gegGarKurzbez" class="java.lang.String"/>	<field name="gegLangbez" class="java.lang.String"/>	<field name="gegNotenattrArt" class="java.lang.Integer"/>	<field name="lfvGegId" class="java.lang.Integer"/>	<field name="lfvGnoKurzbezSem1" class="java.lang.String"/>	<field name="lfvSsdId" class="java.lang.Integer"/>	<field name="mspLangbez" class="java.lang.String"/>	<field name="steAlternativkennz" class="java.lang.String"/>	<field name="stePos" class="java.lang.Integer"/>	<pageHeader>		<band height="20">			<line>				<reportElement x="0" y="19" width="595" height="1"/>			</line>			<staticText>				<reportElement x="0" y="1" width="594" height="19"/>				<textElement textAlignment="Center">					<font fontName="Arial"/>				</textElement>				<text><![CDATA[Pflichtgegenstände]]></text>			</staticText>			<line>				<reportElement x="0" y="0" width="594" height="1"/>			</line>			<line>				<reportElement x="0" y="0" width="1" height="20"/>			</line>			<line>				<reportElement x="594" y="0" width="1" height="20"/>			</line>		</band>	</pageHeader>	<detail>		<band height="16" splitType="Stretch">			<frame>				<reportElement key="gegenstandElement" x="0" y="0" width="296" height="16"/>				<textField isStretchWithOverflow="true">					<reportElement x="1" y="0" width="278" height="16"/>					<box topPadding="2" leftPadding="2" bottomPadding="2" rightPadding="2"/>					<textElement>						<font fontName="Arial"/>					</textElement>					<textFieldExpression class="java.lang.String"><![CDATA[$F{gegLangbez}]]></textFieldExpression>				</textField>				<textField>					<reportElement x="279" y="0" width="17" height="16"/>					<box topPadding="2" leftPadding="2" bottomPadding="2" rightPadding="2"/>					<textElement textAlignment="Right">						<font fontName="Arial"/>					</textElement>					<textFieldExpression class="java.lang.String"><![CDATA[$F{lfvGnoKurzbezSem1}]]></textFieldExpression>				</textField>			</frame>			<line>				<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="0" y="0" width="1" height="16" isPrintWhenDetailOverflows="true"/>			</line>			<line>				<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="297" y="0" width="1" height="16" isPrintWhenDetailOverflows="true"/>			</line>			<line>				<reportElement positionType="FixRelativeToBottom" stretchType="RelativeToTallestObject" x="594" y="0" width="1" height="16" isPrintWhenDetailOverflows="true"/>			</line>		</band>	</detail>	<pageFooter>		<band height="1">			<line>				<reportElement key="gegenstandUnten" x="0" y="0" width="595" height="1"/>			</line>		</band>	</pageFooter></jasperReport>
Link to comment
Share on other sites

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...