lingkongpiaoyi Posted May 20, 2009 Share Posted May 20, 2009 Dear all: I need to display a String which is combined by two Fields in a PDF file,So I create a variable ,the Variable expression just like this: $F{itemDesc}+" / "+$F{itemDescEng}Considering of the result maybe too long to be displayed, I find the [Strech with overflow ] property and checked it. However, it doesn't work.To make sure I'm not making mistake, I checked this property for another Filed( not a Variable )To my suprise, It works.Anyone can help me ? Link to comment Share on other sites More sharing options...
harinderrakkar Posted May 20, 2009 Share Posted May 20, 2009 Hii place this variable in frame ,after that apply [strech with overflow ] property. Or otherwise After placing the string varible in frame,go tto properties of variable,>Common>Stretch type<Relative to tallest Object hope it will work for you . Link to comment Share on other sites More sharing options...
lingkongpiaoyi Posted May 20, 2009 Author Share Posted May 20, 2009 Thank you for your help. I tried a lot,including the [Relative to tallest Object],it still doesn't work. Finally , I decieded to create a new file, and put the variable in [Detail] 1.apply [strech with overflow ] 2.choose [Relative to tallest Object] and it works. I compare the new one with the former one, and find that there is a different: I set [Position Type] as "Float" for the former one while for the new one I choosed "Fix relative to top". Maybe that is the reason... Link to comment Share on other sites More sharing options...
mike2tango Posted September 1, 2014 Share Posted September 1, 2014 This is a Problem and should actually be fixed.Everyone wants to concatenate different fields into one String so order and spaces are as required! Link to comment Share on other sites More sharing options...
mike2tango Posted September 1, 2014 Share Posted September 1, 2014 The given 2 solutions did not work for me. But following did:I created a subreport. In here 2 Parameters. Then I drop the parameter in the Band (my case a Header Band - but presumably any band will do).I select the field and got to Tab "text field" then I enable -Stretch with overflow-.In the parent report I just pass the 2 parameters. Now stretching with any nr of parameters seems to work.... Link to comment Share on other sites More sharing options...
david_71 Posted April 5, 2017 Share Posted April 5, 2017 We had the same problem and found the following workaround.Here is the jrxml source for our variable field that we needed to stretch:<textField isStretchWithOverflow="true"> <reportElement stretchType="RelativeToTallestObject" mode="Transparent" x="0" y="45" width="885" height="13" uuid="2ad9e02e-f4eb-497d-9141-c2a81d396f57"/> <box bottomPadding="0"/> <textFieldExpression><![CDATA[$V{formattedReportParameters}]]></textFieldExpression></textField> 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