mreeds45 Posted January 1, 2009 Share Posted January 1, 2009 Hello All, I am new to jasper reports and am facing a problem with element group and stretch type + position type and stretch with over flow.The problem is that I have two static text elements and and two text field elements placed like the following inside a frame (stretch type = Relative to Tallest Object) element and the elements are grouped together in an Element GroupClient ID: Text Field (Position Type = fixed relative to top)Date Opened: Text Field (Position Type = Float). The text field elements have their property "Stretch with over flow" checked. When the content in the text field over flows, the label "Date Opened" remains where it is defined (stretch type = Relative to Tallest Object) but the text field in front of "Date Opened" shifts accordingly (stretch type = No Stretch)I have no idea why the static text "date opened" is not shifting relative to the tallest Object ? An early response will be highly appreciated. Thanks in advance :)Kind RegardsMaxCode:<?xml version="1.0" encoding="UTF-8" ?><!-- Created with iReport - A designer for JasperReports --><!DOCTYPE jasperReport PUBLIC "//JasperReports//DTD Report Design//EN" "http://jasperreports.sourceforge.net/dtds/jasperreport.dtd"><jasperReport name="test" columnCount="1" printOrder="Vertical" orientation="Portrait" pageWidth="595" pageHeight="842" columnWidth="535" columnSpacing="0" leftMargin="30" rightMargin="30" topMargin="20" bottomMargin="20" whenNoDataType="NoPages" isTitleNewPage="false" isSummaryNewPage="false"> <property name="ireport.scriptlethandling" value="0" /> <property name="ireport.encoding" value="UTF-8" /> <import value="java.util.*" /> <import value="net.sf.jasperreports.engine.*" /> <import value="net.sf.jasperreports.engine.data.*" /> <background> <band height="0" isSplitAllowed="true" > </band> </background> <title> <band height="50" isSplitAllowed="true" > </band> </title> <pageHeader> <band height="101" isSplitAllowed="true" > </band> </pageHeader> <columnHeader> <band height="30" isSplitAllowed="true" > </band> </columnHeader> <detail> <band height="100" isSplitAllowed="true" > <frame> <reportElement x="0" y="0" width="106" height="22" key="frame-1" stretchType="RelativeToTallestObject"/> <box> <pen lineWidth="1.0" lineColor="#000000"/> <topPen lineWidth="1.0" lineColor="#000000"/> <leftPen lineWidth="1.0" lineColor="#000000"/> <bottomPen lineWidth="1.0" lineColor="#000000"/> <rightPen lineWidth="1.0" lineColor="#000000"/></box> </frame> <elementGroup><!-- Start: 1 !--> <textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="73" y="0" width="31" height="11" key="textField-1"/> <box></box> <textElement> <font pdfFontName="Helvetica-Bold" size="8" isBold="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA["1111111111111111111111111111"]]></textFieldExpression> </textField> <textField isStretchWithOverflow="true" isBlankWhenNull="false" evaluationTime="Now" hyperlinkType="None" hyperlinkTarget="Self" > <reportElement x="73" y="11" width="31" height="11" key="textField-2" positionType="Float"/> <box></box> <textElement> <font pdfFontName="Helvetica-Bold" size="8" isBold="true"/> </textElement> <textFieldExpression class="java.lang.String"><![CDATA[new SimpleDateFormat("dd/MM/yyyy h.mm a").format(new Date())]]></textFieldExpression> </textField> <staticText> <reportElement x="1" y="0" width="37" height="11" key="staticText-1"/> <box></box> <textElement> <font pdfFontName="Helvetica-Bold" size="8" isBold="true"/> </textElement> <text><![CDATA[Client ID: ]]></text> </staticText> <staticText> <reportElement x="1" y="11" width="55" height="11" key="staticText-2" positionType="Float"/> <box></box> <textElement> <font pdfFontName="Helvetica-Bold" size="8" isBold="true"/> </textElement> <text><![CDATA[Date Opened: ]]></text> </staticText> </elementGroup><!-- End 1 !--> </band> </detail> <columnFooter> <band height="30" isSplitAllowed="true" > </band> </columnFooter> <pageFooter> <band height="50" isSplitAllowed="true" > </band> </pageFooter> <lastPageFooter> <band height="50" isSplitAllowed="true" > </band> </lastPageFooter> <summary> <band height="50" isSplitAllowed="true" > </band> </summary></jasperReport> Link to comment Share on other sites More sharing options...
offtiz Posted January 1, 2009 Share Posted January 1, 2009 Hi, Just you need to add an empty Static Field (transparent,Position Type = Float) between (Client ID: Text Field ) and (Date Opened: Text Field). Good luckPost Edited by offtiz offtiz at 01/01/09 15:05 Link to comment Share on other sites More sharing options...
mreeds45 Posted January 13, 2009 Author Share Posted January 13, 2009 Hi, Thanks for the swift response and my humblest apologies for replying late (coz of sickness :( ). Well I did'nt get your solution at all.I'm not sure how a transparent static text would do the trick ?Waiting for a favorable reply. Regards.Max Link to comment Share on other sites More sharing options...
pgarret Posted April 28, 2011 Share Posted April 28, 2011 Add a white line (invisible) in between the first row and the second row. Use positionType="Float" for the line and the elements below it.When the text field will stretch, it will push the line which in turn will push the text fields downwards. I hope this helps.G Link to comment Share on other sites More sharing options...
sherryyur Posted April 17, 2012 Share Posted April 17, 2012 I've got the same problem as you. Then tried set all those 4 elements' Stretch type as Relative To Tallest Object, Evaluation Time is Now, and it's working for me. Link to comment Share on other sites More sharing options...
benu Posted November 16, 2013 Share Posted November 16, 2013 G - thanks! This was the perfect solution for me, facing the same challenge. Again, thanks! -Ben Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now