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

wrong calculation and display of stretched text wrap


schmatte

Recommended Posts

Hello,

would like to use a subreport to show a list of data in three textfields in an band with the options  isStretchwithOverflow="true", stretchType="relativeToTallestObject" and verticalAlignment="Bottom" to format the output (see Code).

With this settings I've got the problem, if the text of the first field contains a specific number of characters, the textfield-width-calculation doesn't work properly. For instance the text of line "Umcodierung Postfach nach Postfach:" is located in the pdf-output in one line only, but nevertheless this field has stretched, that's why the content of the other fields "9" and "Sdg." moved to the next line. But this is incorrect. The same problem occured in line "Umcodierung Postfach nach Straße". The other outputs (with longer or shorter first textfield-content) are correct.

I tested it with JasperReport 3.7.2, 3.7.5 and the latest 4.0.1, but everytime I've got the same problem with the pdf-output.

For me it seems like a bug of JasperReport, isn't? 

Regards

   

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="subReportIlvmAnschriftenLeseergebnis" pageWidth="770" pageHeight="688" orientation="Landscape" columnWidth="770" leftMargin="0" rightMargin="0" topMargin="0" bottomMargin="0">	<property name="ireport.zoom" value="1.0"/>	<property name="ireport.x" value="0"/>	<property name="ireport.y" value="0"/>	<style name="StyleColumn" isDefault="false" fontName="Verdana" fontSize="10" pdfFontName="Helvetica"/>	<style name="StyleColumnTwo" isDefault="false" backcolor="#D1D1D1" fontName="Verdana" fontSize="10" pdfFontName="Helvetica"/> 	<!--style name="ParentBackground" backcolor="#FFCC00" fontName="Verdana" pdfFontName="Helvetica" fontSize="10" isDefault="true"/--> 	<style name="ParentBackground" fontName="Verdana" pdfFontName="Helvetica" fontSize="10" isDefault="true"/> 	<style name="BigLetter" style="ParentBackground" fontSize="30"/>    <style name="MediumLetter" style="ParentBackground" fontSize="20"/> 	<style name="NormalLetter" style="ParentBackground" fontSize="11"/>	<style name="Default" isDefault="true" style="ParentBackground"/>	<field name="name" class="java.lang.String"/>	<field name="anzahl" class="java.lang.Long"/>    <field name="einheit" class="java.lang.String"/>	<columnHeader>		<band height="30">			<staticText>				<reportElement style="NormalLetter" mode="Transparent" x="0" y="1" width="195" height="29"/>				<textElement>					<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>				</textElement>				<text><![CDATA[Test:]]></text>			</staticText>        </band>	</columnHeader>    <detail>		<band height="15">     <elementGroup>			<textField isStretchWithOverflow="true">				<reportElement stretchType="RelativeToTallestObject" style="StyleColumn" mode="Opaque" x="0" y="1" width="195" height="14"/>				<textElement textAlignment="Left" verticalAlignment="Bottom">					<font isBold="true" pdfFontName="Helvetica-Bold" isPdfEmbedded="true"/>				</textElement>				<textFieldExpression class="java.lang.String"><![CDATA[$F{name}]]></textFieldExpression>			</textField>			<textField isStretchWithOverflow="true">				<reportElement stretchType="RelativeToTallestObject" style="StyleColumn" mode="Opaque" x="195" y="1" width="60" height="14"/>				<textElement textAlignment="Right" verticalAlignment="Bottom"/>				<textFieldExpression class="java.lang.Long"><![CDATA[$F{anzahl}]]></textFieldExpression>			</textField>			<textField>				<reportElement stretchType="RelativeToTallestObject" style="StyleColumn" x="260" y="1" width="50" height="14"/>				<textElement verticalAlignment="Bottom" />				<textFieldExpression class="java.lang.String"><![CDATA[$F{einheit}]]></textFieldExpression>			</textField>     </elementGroup>		</band>	</detail></jasperReport>
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...